Set HardwareConfig->signature to "FTY" when the keyboard is in factory reset mode, so that Agent can act on it.

This commit is contained in:
László Monda
2018-05-20 01:36:27 +02:00
parent 27b02c32b5
commit a545324693
3 changed files with 26 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
#include "key_scanner.h"
#include "usb_commands/usb_command_apply_config.h"
#include "peripherals/reset_button.h"
#include "config_parser/config_globals.h"
#include "usb_report_updater.h"
static bool IsEepromInitialized = false;
@@ -29,7 +30,10 @@ int main(void)
InitClock();
InitPeripherals();
if (!RESET_BUTTON_IS_PRESSED) {
if (RESET_BUTTON_IS_PRESSED) {
HardwareConfig->signatureLength = HARDWARE_CONFIG_SIGNATURE_LENGTH;
strncpy(HardwareConfig->signature, "FTY", HARDWARE_CONFIG_SIGNATURE_LENGTH);
} else {
EEPROM_LaunchTransfer(EepromOperation_Read, ConfigBufferId_HardwareConfig, hardwareConfigurationReadFinished);
}