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