mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
holybro_can-gps-v1:Add Flash Based Parameters
This commit is contained in:
committed by
Daniel Agar
parent
7b3ce832d6
commit
9e834d26f8
@@ -98,6 +98,8 @@
|
||||
#define HW_INFO_INIT_VER 6
|
||||
#define HW_INFO_INIT_REV 7
|
||||
|
||||
#define FLASH_BASED_PARAMS
|
||||
|
||||
/* CAN Silence
|
||||
*
|
||||
* Silent mode control
|
||||
|
||||
@@ -74,6 +74,9 @@
|
||||
#include <px4_platform/gpio.h>
|
||||
#include <px4_platform/board_determine_hw_info.h>
|
||||
#include <px4_platform/board_dma_alloc.h>
|
||||
# if defined(FLASH_BASED_PARAMS)
|
||||
# include <parameters/flashparams/flashfs.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ideally we'd be able to get these from arm_internal.h,
|
||||
@@ -158,6 +161,23 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
stm32_spiinitialize();
|
||||
|
||||
#if defined(FLASH_BASED_PARAMS)
|
||||
static sector_descriptor_t params_sector_map[] = {
|
||||
{2, 16 * 1024, 0x08008000},
|
||||
{0, 0, 0},
|
||||
};
|
||||
|
||||
/* Initialize the flashfs layer to use heap allocated memory */
|
||||
int result = parameter_flashfs_init(params_sector_map, NULL, 0);
|
||||
|
||||
if (result != OK) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#endif // FLASH_BASED_PARAMS
|
||||
|
||||
|
||||
#if defined(SERIAL_HAVE_RXDMA)
|
||||
/* set up the serial DMA polling */
|
||||
static struct hrt_call serial_dma_call;
|
||||
@@ -183,8 +203,5 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
led_on(LED_GREEN); // Indicate Power.
|
||||
led_off(LED_BLUE);
|
||||
|
||||
/* Configure the HW based on the manifest */
|
||||
|
||||
px4_platform_configure();
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user