Verify a new configuration before applying it

This commit is contained in:
Eric Tang
2017-08-07 11:19:41 -07:00
parent f817a5cbb9
commit 97336455b5
4 changed files with 21 additions and 8 deletions

View File

@@ -3,8 +3,11 @@
static uint8_t hardwareConfig[HARDWARE_CONFIG_SIZE];
config_buffer_t HardwareConfigBuffer = {hardwareConfig};
static uint8_t userConfig[USER_CONFIG_SIZE];
config_buffer_t UserConfigBuffer = {userConfig};
static uint8_t userConfig1[USER_CONFIG_SIZE];
static uint8_t userConfig2[USER_CONFIG_SIZE];
config_buffer_t UserConfigBuffer = { userConfig1 };
config_buffer_t NewUserConfigBuffer = { userConfig2 };
uint8_t readUInt8(config_buffer_t *buffer) {
return buffer->buffer[buffer->offset++];

View File

@@ -23,6 +23,7 @@
extern config_buffer_t HardwareConfigBuffer;
extern config_buffer_t UserConfigBuffer;
extern config_buffer_t NewUserConfigBuffer;
// Functions:

View File

@@ -193,7 +193,7 @@ parser_error_t ParseKeymap(config_buffer_t *buffer) {;
if (layerCount != LAYER_COUNT) {
return ParserError_InvalidLayerCount;
}
isDryRun = !isDefault;
isDryRun = buffer == &NewUserConfigBuffer || !isDefault;
if (!isDryRun) {
LedDisplay_SetText(abbreviationLen, abbreviation);
}