summaryrefslogtreecommitdiff
path: root/tmk_core/common/eeconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/eeconfig.c')
-rw-r--r--tmk_core/common/eeconfig.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c
index 72f198d6ce..20d64438b1 100644
--- a/tmk_core/common/eeconfig.c
+++ b/tmk_core/common/eeconfig.c
@@ -9,6 +9,11 @@
# include "eeprom_stm32.h"
#endif
+#if defined(EEPROM_DRIVER)
+# include "eeprom_driver.h"
+#endif
+
+extern uint32_t default_layer_state;
/** \brief eeconfig enable
*
* FIXME: needs doc
@@ -32,6 +37,9 @@ void eeconfig_init_quantum(void) {
#ifdef STM32_EEPROM_ENABLE
EEPROM_Erase();
#endif
+#if defined(EEPROM_DRIVER)
+ eeprom_driver_erase();
+#endif
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
eeprom_update_byte(EECONFIG_DEBUG, 0);
eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0);
@@ -81,6 +89,9 @@ void eeconfig_disable(void) {
#ifdef STM32_EEPROM_ENABLE
EEPROM_Erase();
#endif
+#if defined(EEPROM_DRIVER)
+ eeprom_driver_erase();
+#endif
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF);
}