From 0e29276a56e8151246624e096e896f3ef262a41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Mon, 21 May 2018 12:04:12 +0200 Subject: [PATCH] Read the hardware and user configuration from the EEPROM even in factory reset mode. --- right/src/main.c | 4 ++-- right/src/usb_commands/usb_command_apply_config.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/right/src/main.c b/right/src/main.c index 834fc23..9055c45 100644 --- a/right/src/main.c +++ b/right/src/main.c @@ -34,10 +34,10 @@ int main(void) if (IsFactoryResetModeEnabled) { HardwareConfig->signatureLength = HARDWARE_CONFIG_SIGNATURE_LENGTH; strncpy(HardwareConfig->signature, "FTY", HARDWARE_CONFIG_SIGNATURE_LENGTH); - } else { - EEPROM_LaunchTransfer(EepromOperation_Read, ConfigBufferId_HardwareConfig, hardwareConfigurationReadFinished); } + EEPROM_LaunchTransfer(EepromOperation_Read, ConfigBufferId_HardwareConfig, hardwareConfigurationReadFinished); + if (IsBusPalOn) { init_hardware(); handleUsbBusPalCommand(); diff --git a/right/src/usb_commands/usb_command_apply_config.c b/right/src/usb_commands/usb_command_apply_config.c index bc337b7..627fd0a 100644 --- a/right/src/usb_commands/usb_command_apply_config.c +++ b/right/src/usb_commands/usb_command_apply_config.c @@ -1,6 +1,7 @@ #include "usb_commands/usb_command_apply_config.h" #include "config_parser/config_globals.h" #include "config_parser/parse_config.h" +#include "peripherals/reset_button.h" #include "usb_protocol_handler.h" #include "keymap.h" @@ -35,6 +36,10 @@ void UsbCommand_ApplyConfig(void) ValidatedUserConfigBuffer.buffer = StagingUserConfigBuffer.buffer; StagingUserConfigBuffer.buffer = temp; + if (IsFactoryResetModeEnabled) { + return; + } + ParserRunDry = false; ValidatedUserConfigBuffer.offset = 0; parseConfigStatus = ParseConfig(&ValidatedUserConfigBuffer);