X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Feeconfig.c;h=5bd47dc6ad242c9fec46e09e8f568dca6ae8134d;hb=221af6bffbb8c5af57ae64068d34e5ea165b3a82;hp=cea3810ee30046eae643bbe234bbe45a5905751d;hpb=d055e0633e36e97802d60554f6002e47021ba5fd;p=tmk_firmware.git diff --git a/common/eeconfig.c b/common/eeconfig.c index cea3810..5bd47dc 100644 --- a/common/eeconfig.c +++ b/common/eeconfig.c @@ -3,14 +3,16 @@ #include #include "eeconfig.h" - void eeconfig_init(void) { eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); eeprom_write_byte(EECONFIG_DEBUG, 0); eeprom_write_byte(EECONFIG_DEFAULT_LAYER, 0); - eeprom_write_byte(EECONFIG_KEYCONF, 0); + eeprom_write_byte(EECONFIG_KEYMAP, 0); eeprom_write_byte(EECONFIG_MOUSEKEY_ACCEL, 0); +#ifdef BACKLIGHT_ENABLE + eeprom_write_byte(EECONFIG_BACKLIGHT, 0); +#endif } void eeconfig_enable(void) @@ -25,14 +27,19 @@ void eeconfig_disable(void) bool eeconfig_is_enabled(void) { - return EECONFIG_IS_ENABLED() && (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER); + return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER); } uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); } void eeconfig_write_debug(uint8_t val) { eeprom_write_byte(EECONFIG_DEBUG, val); } -uint8_t eeconfig_read_defalt_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); } -void eeconfig_write_defalt_layer(uint8_t val) { eeprom_write_byte(EECONFIG_DEFAULT_LAYER, val); } +uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); } +void eeconfig_write_default_layer(uint8_t val) { eeprom_write_byte(EECONFIG_DEFAULT_LAYER, val); } + +uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); } +void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val); } -uint8_t eeconfig_read_keyconf(void) { return eeprom_read_byte(EECONFIG_KEYCONF); } -void eeconfig_write_keyconf(uint8_t val) { eeprom_write_byte(EECONFIG_KEYCONF, val); } +#ifdef BACKLIGHT_ENABLE +uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); } +void eeconfig_write_backlight(uint8_t val) { eeprom_write_byte(EECONFIG_BACKLIGHT, val); } +#endif