From 2c4b8eaec3b3530862d37e8238fd82061da16d3b Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 6 Jun 2019 11:26:56 +0200 Subject: [PATCH] Cleanup defaults for alternative config storage. * Provide defaults for EEPROM_SIZE. * __config_start/end. --- src/main/target/SITL/target.h | 6 ------ src/main/target/common_post.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/target/SITL/target.h b/src/main/target/SITL/target.h index ee5bb2d3f..d100a7175 100644 --- a/src/main/target/SITL/target.h +++ b/src/main/target/SITL/target.h @@ -144,12 +144,6 @@ extern uint32_t SystemCoreClock; -#ifdef EEPROM_IN_FILE -extern uint8_t eepromData[EEPROM_SIZE]; -#define __config_start (*eepromData) -#define __config_end (*ARRAYEND(eepromData)) -#endif - typedef enum { Mode_TEST = 0x0, diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index 8dff7f5dc..34e759ed2 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -338,7 +338,17 @@ #undef USE_ESCSERIAL #endif -#if !defined(EEPROM_IN_RAM) && !defined(EEPROM_IN_FILE) +#if defined(EEPROM_IN_RAM) || defined(EEPROM_IN_FILE) +#ifndef EEPROM_SIZE +#define EEPROM_SIZE 4096 +#endif +extern uint8_t eepromData[EEPROM_SIZE]; +#define __config_start (*eepromData) +#define __config_end (*ARRAYEND(eepromData)) +#else +#ifndef EEPROM_IN_FLASH +#define EEPROM_IN_FLASH +#endif extern uint8_t __config_start; // configured via linker script when building binaries. extern uint8_t __config_end; #endif