Add EEPROM reset functionality

This commit is contained in:
Drashna Jael're
2020-01-15 02:21:11 -08:00
committed by Florian Didron
parent 3b71e1e819
commit a8e4c490bf
3 changed files with 13 additions and 2 deletions

View File

@@ -228,3 +228,9 @@ void layer_state_set_oryx(layer_state_t state) {
webusb_send(event, sizeof(event)); webusb_send(event, sizeof(event));
} }
} }
void eeconfig_init_oryx(void) {
// reread settings from flash into eeprom
dynamic_keymap_reset();
dynamic_keymap_macro_reset();
}

View File

@@ -81,4 +81,5 @@ void oryx_layer_event(void);
bool is_oryx_live_training_enabled(void); bool is_oryx_live_training_enabled(void);
bool process_record_oryx(uint16_t keycode, keyrecord_t *record); bool process_record_oryx(uint16_t keycode, keyrecord_t *record);
void layer_state_set_oryx(layer_state_t state); void layer_state_set_oryx(layer_state_t state);
void eeconfig_init_oryx(void);
void keyboard_pre_init_oryx(void); void keyboard_pre_init_oryx(void);

View File

@@ -3,7 +3,9 @@
#include "eeprom.h" #include "eeprom.h"
#include "eeconfig.h" #include "eeconfig.h"
#include "action_layer.h" #include "action_layer.h"
#ifdef ORYX_ENABLE
# include "oryx.h"
#endif
#ifdef STM32_EEPROM_ENABLE #ifdef STM32_EEPROM_ENABLE
# include "hal.h" # include "hal.h"
# include "eeprom_stm32.h" # include "eeprom_stm32.h"
@@ -65,7 +67,9 @@ void eeconfig_init_quantum(void) {
#pragma message "Faking EE_HANDS for right hand" #pragma message "Faking EE_HANDS for right hand"
eeprom_update_byte(EECONFIG_HANDEDNESS, 0); eeprom_update_byte(EECONFIG_HANDEDNESS, 0);
#endif #endif
#ifdef ORYX_ENABLE
eeconfig_init_oryx();
#endif
eeconfig_init_kb(); eeconfig_init_kb();
} }