Make saving the user configuration faster by only writing the part of the EEPROM which actually contains the user configuration. Resolves #111.
This commit is contained in:
@@ -6,6 +6,7 @@ static uint8_t hardwareConfig[HARDWARE_CONFIG_SIZE];
|
||||
static uint8_t ATTR_DATA2 stagingUserConfig[USER_CONFIG_SIZE];
|
||||
static uint8_t validatedUserConfig[USER_CONFIG_SIZE];
|
||||
|
||||
uint16_t ValidatedUserConfigLength;
|
||||
config_buffer_t HardwareConfigBuffer = { hardwareConfig };
|
||||
config_buffer_t StagingUserConfigBuffer = { stagingUserConfig };
|
||||
config_buffer_t ValidatedUserConfigBuffer = { validatedUserConfig };
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
// Variables:
|
||||
|
||||
extern bool ParserRunDry;
|
||||
extern uint16_t ValidatedUserConfigLength;
|
||||
extern config_buffer_t HardwareConfigBuffer;
|
||||
extern config_buffer_t StagingUserConfigBuffer;
|
||||
extern config_buffer_t ValidatedUserConfigBuffer;
|
||||
|
||||
@@ -51,7 +51,6 @@ parser_error_t ParseConfig(config_buffer_t *buffer)
|
||||
const char *deviceName = ReadString(buffer, &len);
|
||||
uint16_t doubleTapSwitchLayerTimeout = ReadUInt16(buffer);
|
||||
|
||||
(void)userConfigLength;
|
||||
(void)dataModelMajorVersion;
|
||||
(void)dataModelMinorVersion;
|
||||
(void)dataModelPatchVersion;
|
||||
@@ -141,6 +140,8 @@ parser_error_t ParseConfig(config_buffer_t *buffer)
|
||||
|
||||
// Update LED brightnesses and reinitialize LED drivers
|
||||
|
||||
ValidatedUserConfigLength = userConfigLength;
|
||||
|
||||
IconsAndLayerTextsBrightness = iconsAndLayerTextsBrightness;
|
||||
AlphanumericSegmentsBrightness = alphanumericSegmentsBrightness;
|
||||
KeyBacklightBrightness = keyBacklightBrightness;
|
||||
|
||||
Reference in New Issue
Block a user