From d550603b8c64a3fc9befde3c87a81f0f1cc9d6ab Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Thu, 30 Jan 2020 13:34:37 -0800 Subject: Add firmware ID check --- quantum/oryx.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/quantum/oryx.c b/quantum/oryx.c index e6bd2d7689..7650fadc0b 100644 --- a/quantum/oryx.c +++ b/quantum/oryx.c @@ -1,4 +1,6 @@ #include "oryx.h" +#include "eeprom.h" +#include bool oryx_state_live_training_enabled; @@ -229,10 +231,23 @@ void layer_state_set_oryx(layer_state_t state) { } } +#ifdef DYNAMIC_KEYMAP_ENABLE void eeconfig_init_oryx(void) { // reread settings from flash into eeprom -#ifdef DYNAMIC_KEYMAP_ENABLE dynamic_keymap_reset(); dynamic_keymap_macro_reset(); -#endif + eeprom_update_block(FIRMWARE_VERSION, (uint8_t *)EECONFIG_SIZE, sizeof(uint8_t)*17); +} + +// since I'm being lazy, ATM +void matrix_setup(void) { + uint8_t temp[17]; + uint8_t firmware[17] = FIRMWARE_VERSION; + eeprom_read_block(&temp, (uint8_t *)EECONFIG_SIZE, sizeof(uint8_t)*17); + if (!memcmp(&temp, &firmware, sizeof(uint8_t)*17)) { + eeconfig_init_oryx(); + } } +// FIRMWARE_VERSION + +#endif -- cgit v1.2.3