mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 16:56:25 +08:00
TAP used FLASH Based parameter storage - needs timing eval
This commit is contained in:
committed by
Julian Oes
parent
8d13dba0cc
commit
5d1bd6fb2c
@@ -236,6 +236,9 @@ __BEGIN_DECLS
|
||||
#define KEY_AD_GPIO (GPIO_INPUT|GPIO_PULLDOWN|GPIO_EXTI|GPIO_PORTC|GPIO_PIN1)
|
||||
#define POWER_ON_GPIO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4)
|
||||
#define POWER_OFF_GPIO (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN4)
|
||||
|
||||
|
||||
#define FLASH_BASED_PARAMS
|
||||
/****************************************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************************************/
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
#include <nuttx/i2c.h>
|
||||
#include <nuttx/analog/adc.h>
|
||||
|
||||
|
||||
|
||||
#include "stm32.h"
|
||||
#include "board_config.h"
|
||||
#include "stm32_uart.h"
|
||||
@@ -68,6 +70,10 @@
|
||||
|
||||
#include <systemlib/cpuload.h>
|
||||
|
||||
# if defined(FLASH_BASED_PARAMS)
|
||||
# include <systemlib/flashparams/flashfs.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
@@ -179,6 +185,25 @@ __EXPORT int nsh_archinitialize(void)
|
||||
led_off(LED_AMBER);
|
||||
led_off(LED_BLUE);
|
||||
|
||||
#if defined(FLASH_BASED_PARAMS)
|
||||
static sector_descriptor_t sector_map[] = {
|
||||
{1, 16 * 1024, 0x08004000},
|
||||
{2, 16 * 1024, 0x08008000},
|
||||
{0, 0, 0},
|
||||
};
|
||||
|
||||
/* Initalizee the flashfs layer to use heap allocated memory */
|
||||
|
||||
result = parameter_flashfs_init(sector_map, NULL, 0);
|
||||
|
||||
if (result != OK) {
|
||||
message("[boot] FAILED to init params in FLASH %d\n", result);
|
||||
up_ledon(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Init the microSD slot */
|
||||
|
||||
result = board_sdio_initialize();
|
||||
|
||||
Reference in New Issue
Block a user