aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
authorEric Tang <e_l_tang@outlook.com>2016-04-21 19:35:18 -0700
committerEric Tang <e_l_tang@outlook.com>2016-04-21 20:07:03 -0700
commit620ac4b260fa663d12b11a0b15ac50379523c125 (patch)
tree97c07e85ab7acb939ff395e4ba12d950d805a8f6 /tmk_core
parent9828aba2a12f03fccbc1095bc8e4918ae58fa31b (diff)
downloadfirmware-620ac4b260fa663d12b11a0b15ac50379523c125.tar.gz
firmware-620ac4b260fa663d12b11a0b15ac50379523c125.tar.bz2
firmware-620ac4b260fa663d12b11a0b15ac50379523c125.zip
Update functions used to write to EEPROM
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/avr/eeconfig.c30
-rw-r--r--tmk_core/common/backlight.c10
-rw-r--r--tmk_core/common/bootmagic.c6
-rw-r--r--tmk_core/common/eeconfig.h10
-rw-r--r--tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c4
-rw-r--r--tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c2
6 files changed, 31 insertions, 31 deletions
diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c
index 25bb9e849..c5391f5cf 100644
--- a/tmk_core/common/avr/eeconfig.c
+++ b/tmk_core/common/avr/eeconfig.c
@@ -5,27 +5,27 @@
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_KEYMAP, 0);
- eeprom_write_byte(EECONFIG_MOUSEKEY_ACCEL, 0);
+ eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
+ eeprom_update_byte(EECONFIG_DEBUG, 0);
+ eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0);
+ eeprom_update_byte(EECONFIG_KEYMAP, 0);
+ eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0);
#ifdef BACKLIGHT_ENABLE
- eeprom_write_byte(EECONFIG_BACKLIGHT, 0);
+ eeprom_update_byte(EECONFIG_BACKLIGHT, 0);
#endif
#ifdef AUDIO_ENABLE
- eeprom_write_byte(EECONFIG_AUDIO, 0xFF); // On by default
+ eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default
#endif
}
void eeconfig_enable(void)
{
- eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
+ eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
}
void eeconfig_disable(void)
{
- eeprom_write_word(EECONFIG_MAGIC, 0xFFFF);
+ eeprom_update_word(EECONFIG_MAGIC, 0xFFFF);
}
bool eeconfig_is_enabled(void)
@@ -34,20 +34,20 @@ bool eeconfig_is_enabled(void)
}
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); }
+void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, 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); }
+void eeconfig_update_default_layer(uint8_t val) { eeprom_update_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); }
+void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, 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); }
+void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); }
#endif
#ifdef AUDIO_ENABLE
uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); }
-void eeconfig_write_audio(uint8_t val) { eeprom_write_byte(EECONFIG_AUDIO, val); }
-#endif \ No newline at end of file
+void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); }
+#endif
diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c
index 558ad9b01..2f6fc1cd6 100644
--- a/tmk_core/common/backlight.c
+++ b/tmk_core/common/backlight.c
@@ -37,7 +37,7 @@ void backlight_increase(void)
{
backlight_config.level++;
backlight_config.enable = 1;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
}
dprintf("backlight increase: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
@@ -49,7 +49,7 @@ void backlight_decrease(void)
{
backlight_config.level--;
backlight_config.enable = !!backlight_config.level;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
}
dprintf("backlight decrease: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
@@ -58,7 +58,7 @@ void backlight_decrease(void)
void backlight_toggle(void)
{
backlight_config.enable ^= 1;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
dprintf("backlight toggle: %u\n", backlight_config.enable);
backlight_set(backlight_config.enable ? backlight_config.level : 0);
}
@@ -71,7 +71,7 @@ void backlight_step(void)
backlight_config.level = 0;
}
backlight_config.enable = !!backlight_config.level;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
dprintf("backlight step: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
}
@@ -80,6 +80,6 @@ void backlight_level(uint8_t level)
{
backlight_config.level ^= level;
backlight_config.enable = !!backlight_config.level;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
backlight_set(backlight_config.level);
}
diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c
index b002a5856..2c1b1adfc 100644
--- a/tmk_core/common/bootmagic.c
+++ b/tmk_core/common/bootmagic.c
@@ -52,7 +52,7 @@ void bootmagic(void)
debug_config.enable = !debug_config.enable;
}
}
- eeconfig_write_debug(debug_config.raw);
+ eeconfig_update_debug(debug_config.raw);
/* keymap config */
keymap_config.raw = eeconfig_read_keymap();
@@ -80,7 +80,7 @@ void bootmagic(void)
if (bootmagic_scan_keycode(BOOTMAGIC_HOST_NKRO)) {
keymap_config.nkro = !keymap_config.nkro;
}
- eeconfig_write_keymap(keymap_config.raw);
+ eeconfig_update_keymap(keymap_config.raw);
#ifdef NKRO_ENABLE
keyboard_nkro = keymap_config.nkro;
@@ -97,7 +97,7 @@ void bootmagic(void)
if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_6)) { default_layer |= (1<<6); }
if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_7)) { default_layer |= (1<<7); }
if (default_layer) {
- eeconfig_write_default_layer(default_layer);
+ eeconfig_update_default_layer(default_layer);
default_layer_set((uint32_t)default_layer);
} else {
default_layer = eeconfig_read_default_layer();
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h
index ddefca134..ca47e0d2f 100644
--- a/tmk_core/common/eeconfig.h
+++ b/tmk_core/common/eeconfig.h
@@ -60,22 +60,22 @@ void eeconfig_enable(void);
void eeconfig_disable(void);
uint8_t eeconfig_read_debug(void);
-void eeconfig_write_debug(uint8_t val);
+void eeconfig_update_debug(uint8_t val);
uint8_t eeconfig_read_default_layer(void);
-void eeconfig_write_default_layer(uint8_t val);
+void eeconfig_update_default_layer(uint8_t val);
uint8_t eeconfig_read_keymap(void);
-void eeconfig_write_keymap(uint8_t val);
+void eeconfig_update_keymap(uint8_t val);
#ifdef BACKLIGHT_ENABLE
uint8_t eeconfig_read_backlight(void);
-void eeconfig_write_backlight(uint8_t val);
+void eeconfig_update_backlight(uint8_t val);
#endif
#ifdef AUDIO_ENABLE
uint8_t eeconfig_read_audio(void);
-void eeconfig_write_audio(uint8_t val);
+void eeconfig_update_audio(uint8_t val);
#endif
#endif
diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c
index f66a483e6..58bb33892 100644
--- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c
+++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c
@@ -327,7 +327,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
else
{
/* Write the next EEPROM byte from the endpoint */
- eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
+ eeprom_update_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
/* Increment the address counter after use */
CurrAddress += 2;
@@ -581,7 +581,7 @@ static void CDC_Task(void)
else if (Command == AVR109_COMMAND_WriteEEPROM)
{
/* Read the byte from the endpoint and write it to the EEPROM */
- eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
+ eeprom_update_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
/* Increment the address after use */
CurrAddress += 2;
diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c
index 0385bfc49..00e673268 100644
--- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c
+++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c
@@ -370,7 +370,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* Read the byte from the USB interface and write to to the EEPROM */
- eeprom_write_byte((uint8_t*)StartAddr, Endpoint_Read_8());
+ eeprom_update_byte((uint8_t*)StartAddr, Endpoint_Read_8());
/* Adjust counters */
StartAddr++;