From b3216439de1a2023efb352eb34506ea4cc540f6e Mon Sep 17 00:00:00 2001 From: JOhn Aughey Date: Thu, 28 Apr 2016 12:57:14 -0500 Subject: [PATCH] Allow the address of the start of the flash space to be defined externally. For testing, the flash memory can be allocated and defined to a different region than on an embedded processor. --- src/main/config/config.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/config/config.c b/src/main/config/config.c index 116692ee13..07cb5abbaf 100755 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -124,8 +124,15 @@ void useRcControlsConfig(modeActivationCondition_t *modeActivationConditions, es #define FLASH_TO_RESERVE_FOR_CONFIG 0x1000 #endif +// use the last flash pages for storage +#ifdef CUSTOM_FLASH_MEMORY_ADDRESS +size_t custom_flash_memory_address = 0; +#define CONFIG_START_FLASH_ADDRESS (custom_flash_memory_address) +#else // use the last flash pages for storage #define CONFIG_START_FLASH_ADDRESS (0x08000000 + (uint32_t)((FLASH_PAGE_SIZE * FLASH_PAGE_COUNT) - FLASH_TO_RESERVE_FOR_CONFIG)) +#endif + master_t masterConfig; // master config struct with data independent from profiles profile_t *currentProfile;