diff --git a/src/main/config/config_eeprom.c b/src/main/config/config_eeprom.c index 12f5bd1690..b94b3512d5 100644 --- a/src/main/config/config_eeprom.c +++ b/src/main/config/config_eeprom.c @@ -18,7 +18,6 @@ #include #include #include -#include #include "platform.h" @@ -26,19 +25,12 @@ #include "common/maths.h" -#include "drivers/light_led.h" - #include "config/config_eeprom.h" #include "config/config_streamer.h" #include "config/parameter_group.h" #include "drivers/system.h" -#include "fc/config.h" -#include "fc/rc_adjustments.h" - -#include "flight/pid.h" - extern uint8_t __config_start; // configured via linker script when building binaries. extern uint8_t __config_end; @@ -242,9 +234,8 @@ static bool writeSettingsToEEPROM(void) crc = crc16_ccitt_update(crc, reg->address, regSize); } else { // write one instance for each profile - for (uint8_t profileIndex = 0; profileIndex < MAX_PROFILE_COUNT; profileIndex++) { + for (uint8_t profileIndex = 0; profileIndex < PG_PROFILE_COUNT; profileIndex++) { record.flags = 0; - record.flags |= ((profileIndex + 1) & CR_CLASSIFICATION_MASK); config_streamer_write(&streamer, (uint8_t *)&record, sizeof(record)); crc = crc16_ccitt_update(crc, (uint8_t *)&record, sizeof(record)); diff --git a/src/main/config/parameter_group.h b/src/main/config/parameter_group.h index f08a83e8b9..3ac0f0946b 100644 --- a/src/main/config/parameter_group.h +++ b/src/main/config/parameter_group.h @@ -38,6 +38,10 @@ typedef enum { PGR_SIZE_PROFILE_FLAG = 0x8000 // start using flags from the top bit down } pgRegistryInternal_e; +enum { + PG_PROFILE_COUNT = 3 +}; + // function that resets a single parameter group instance typedef void (pgResetFunc)(void * /* base */, int /* size */); @@ -194,7 +198,7 @@ extern const uint8_t __pg_resetdata_end[]; // register profile config #define PG_REGISTER_PROFILE_I(_type, _name, _pgn, _version, _reset) \ - STATIC_UNIT_TESTED _type _name ## _Storage[MAX_PROFILE_COUNT]; \ + STATIC_UNIT_TESTED _type _name ## _Storage[PG_PROFILE_COUNT]; \ _PG_PROFILE_CURRENT_DECL(_type, _name) \ extern const pgRegistry_t _name ## _Registry; \ const pgRegistry_t _name ## _Registry PG_REGISTER_ATTRIBUTES = { \