Read the hardware and user configuration from the EEPROM even in factory reset mode.

This commit is contained in:
László Monda
2018-05-21 12:04:12 +02:00
parent 5b90d78518
commit 0e29276a56
2 changed files with 7 additions and 2 deletions

View File

@@ -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();

View File

@@ -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);