diff options
| author | tmk <nobody@nowhere> | 2013-04-07 15:36:50 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2013-04-07 15:36:50 +0900 |
| commit | 4e93b3fa67d3b8170de2f05322738e08ac17948e (patch) | |
| tree | 46b5191bd9e6c591bc13e05aa97a0454f30b1897 /common/eeconfig.c | |
| parent | 78fd5a715464e72df08bcf683ca45b63c2df490f (diff) | |
| download | qmk_firmware-4e93b3fa67d3b8170de2f05322738e08ac17948e.tar.gz qmk_firmware-4e93b3fa67d3b8170de2f05322738e08ac17948e.zip | |
Fix bootmagic and eeconfig for virtual DIP SW
Diffstat (limited to 'common/eeconfig.c')
| -rw-r--r-- | common/eeconfig.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/eeconfig.c b/common/eeconfig.c index cea3810ee..0481d4b9c 100644 --- a/common/eeconfig.c +++ b/common/eeconfig.c | |||
| @@ -3,13 +3,12 @@ | |||
| 3 | #include <avr/eeprom.h> | 3 | #include <avr/eeprom.h> |
| 4 | #include "eeconfig.h" | 4 | #include "eeconfig.h" |
| 5 | 5 | ||
| 6 | |||
| 7 | void eeconfig_init(void) | 6 | void eeconfig_init(void) |
| 8 | { | 7 | { |
| 9 | eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); | 8 | eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); |
| 10 | eeprom_write_byte(EECONFIG_DEBUG, 0); | 9 | eeprom_write_byte(EECONFIG_DEBUG, 0); |
| 11 | eeprom_write_byte(EECONFIG_DEFAULT_LAYER, 0); | 10 | eeprom_write_byte(EECONFIG_DEFAULT_LAYER, 0); |
| 12 | eeprom_write_byte(EECONFIG_KEYCONF, 0); | 11 | eeprom_write_byte(EECONFIG_KEYMAP, 0); |
| 13 | eeprom_write_byte(EECONFIG_MOUSEKEY_ACCEL, 0); | 12 | eeprom_write_byte(EECONFIG_MOUSEKEY_ACCEL, 0); |
| 14 | } | 13 | } |
| 15 | 14 | ||
| @@ -25,7 +24,7 @@ void eeconfig_disable(void) | |||
| 25 | 24 | ||
| 26 | bool eeconfig_is_enabled(void) | 25 | bool eeconfig_is_enabled(void) |
| 27 | { | 26 | { |
| 28 | return EECONFIG_IS_ENABLED() && (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER); | 27 | return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER); |
| 29 | } | 28 | } |
| 30 | 29 | ||
| 31 | uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); } | 30 | uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); } |
| @@ -34,5 +33,5 @@ void eeconfig_write_debug(uint8_t val) { eeprom_write_byte(EECONFIG_DEBUG, val); | |||
| 34 | uint8_t eeconfig_read_defalt_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); } | 33 | uint8_t eeconfig_read_defalt_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); } |
| 35 | void eeconfig_write_defalt_layer(uint8_t val) { eeprom_write_byte(EECONFIG_DEFAULT_LAYER, val); } | 34 | void eeconfig_write_defalt_layer(uint8_t val) { eeprom_write_byte(EECONFIG_DEFAULT_LAYER, val); } |
| 36 | 35 | ||
| 37 | uint8_t eeconfig_read_keyconf(void) { return eeprom_read_byte(EECONFIG_KEYCONF); } | 36 | uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); } |
| 38 | void eeconfig_write_keyconf(uint8_t val) { eeprom_write_byte(EECONFIG_KEYCONF, val); } | 37 | void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val); } |
