Browse Source

Change logic of resetting keymap in eeprom

core
Kai Ryu 10 years ago
parent
commit
f8443e306b
2 changed files with 4 additions and 8 deletions
  1. 4
    1
      common/bootmagic.c
  2. 0
    7
      common/eeconfig.c

+ 4
- 1
common/bootmagic.c View File

@@ -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 */

+ 0
- 7
common/eeconfig.c View File

@@ -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)