From 7cdfbab020446fe0446da0af1143ee5aedb050a5 Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Fri, 11 Apr 2014 12:12:03 +0900 Subject: [PATCH] Change logic of resetting keymap in eeprom --- common/bootmagic.c | 5 ++++- common/eeconfig.c | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/common/bootmagic.c b/common/bootmagic.c index 311a02f2..0baff830 100644 --- a/common/bootmagic.c +++ b/common/bootmagic.c @@ -7,6 +7,7 @@ #include "keymap.h" #include "action_layer.h" #include "eeconfig.h" +#include "keymap_in_eeprom.h" #include "bootmagic.h" @@ -30,8 +31,10 @@ void bootmagic(void) /* eeconfig clear */ if (bootmagic_scan_keycode(BOOTMAGIC_KEY_EEPROM_CLEAR)) { - eeconfig_disable(); eeconfig_init(); +#ifdef KEYMAP_IN_EEPROM_ENABLE + write_keymap_to_eeprom(); +#endif } /* bootloader */ diff --git a/common/eeconfig.c b/common/eeconfig.c index d98cd61a..5bd47dc6 100644 --- a/common/eeconfig.c +++ b/common/eeconfig.c @@ -2,7 +2,6 @@ #include #include #include "eeconfig.h" -#include "keymap_in_eeprom.h" void eeconfig_init(void) { @@ -14,9 +13,6 @@ void eeconfig_init(void) #ifdef BACKLIGHT_ENABLE eeprom_write_byte(EECONFIG_BACKLIGHT, 0); #endif -#ifdef KEYMAP_IN_EEPROM_ENABLE - keymap_in_eeprom_init(); -#endif } void eeconfig_enable(void) @@ -27,9 +23,6 @@ void eeconfig_enable(void) void eeconfig_disable(void) { eeprom_write_word(EECONFIG_MAGIC, 0xFFFF); -#ifdef KEYMAP_IN_EEPROM_ENABLE - keymap_in_eeprom_disable(); -#endif } bool eeconfig_is_enabled(void)