mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Merge pull request #2642 from martinbudden/bf_config_eeprom_tidy
Removed unnecessary headers from config_eeprom.c
This commit is contained in:
commit
67467b22b9
2 changed files with 6 additions and 11 deletions
|
@ -18,7 +18,6 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#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));
|
||||
|
|
|
@ -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 = { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue