Change logic of resetting keymap in eeprom
This commit is contained in:
parent
0f31162554
commit
7cdfbab020
@ -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 */
|
||||
|
@ -2,7 +2,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <avr/eeprom.h>
|
||||
#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)
|
||||
|
Reference in New Issue
Block a user