summaryrefslogtreecommitdiff
path: root/quantum/oryx.c
diff options
context:
space:
mode:
authorDrashna Jael're <drashna@live.com>2020-01-30 13:34:37 -0800
committerFlorian Didron <fdidron@users.noreply.github.com>2020-02-26 10:15:12 +0900
commitd550603b8c64a3fc9befde3c87a81f0f1cc9d6ab (patch)
tree4916f9ea32b620bef860d7309e5538b167c83a67 /quantum/oryx.c
parentc72b69194c9e2d703c8af51a6f303f6fedc51b0c (diff)
Add firmware ID check
Diffstat (limited to 'quantum/oryx.c')
-rw-r--r--quantum/oryx.c19
1 files 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 <string.h>
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