summaryrefslogtreecommitdiffstats
path: root/quantum
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 /quantum
parent9828aba2a12f03fccbc1095bc8e4918ae58fa31b (diff)
Update functions used to write to EEPROM
Diffstat (limited to 'quantum')
-rw-r--r--quantum/audio/audio.c6
-rw-r--r--quantum/keymap_common.c2
-rw-r--r--quantum/rgblight.c20
-rw-r--r--quantum/rgblight.h4
4 files changed, 16 insertions, 16 deletions
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
index 3225557bae..e85370d958 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio.c
@@ -85,17 +85,17 @@ uint16_t envelope_index = 0;
void audio_toggle(void) {
audio_config.enable ^= 1;
- eeconfig_write_audio(audio_config.raw);
+ eeconfig_update_audio(audio_config.raw);
}
void audio_on(void) {
audio_config.enable = 1;
- eeconfig_write_audio(audio_config.raw);
+ eeconfig_update_audio(audio_config.raw);
}
void audio_off(void) {
audio_config.enable = 0;
- eeconfig_write_audio(audio_config.raw);
+ eeconfig_update_audio(audio_config.raw);
}
#ifdef VIBRATO_ENABLE
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index 43debf4ef6..4b4bd62109 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -245,7 +245,7 @@ static action_t keycode_to_action(uint16_t keycode)
keymap_config.swap_lalt_lgui = 0;
keymap_config.swap_ralt_rgui = 0;
}
- eeconfig_write_keymap(keymap_config.raw);
+ eeconfig_update_keymap(keymap_config.raw);
break;
case 0x5100 ... 0x5FFF: ;
// Layer movement shortcuts
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 2215cf5cdf..5623c65de7 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -107,17 +107,17 @@ void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1) {
uint32_t eeconfig_read_rgblight(void) {
return eeprom_read_dword(EECONFIG_RGBLIGHT);
}
-void eeconfig_write_rgblight(uint32_t val) {
- eeprom_write_dword(EECONFIG_RGBLIGHT, val);
+void eeconfig_update_rgblight(uint32_t val) {
+ eeprom_update_dword(EECONFIG_RGBLIGHT, val);
}
-void eeconfig_write_rgblight_default(void) {
- dprintf("eeconfig_write_rgblight_default\n");
+void eeconfig_update_rgblight_default(void) {
+ dprintf("eeconfig_update_rgblight_default\n");
rgblight_config.enable = 1;
rgblight_config.mode = 1;
rgblight_config.hue = 200;
rgblight_config.sat = 204;
rgblight_config.val = 204;
- eeconfig_write_rgblight(rgblight_config.raw);
+ eeconfig_update_rgblight(rgblight_config.raw);
}
void eeconfig_debug_rgblight(void) {
dprintf("rgblight_config eprom\n");
@@ -136,12 +136,12 @@ void rgblight_init(void) {
if (!eeconfig_is_enabled()) {
dprintf("rgblight_init eeconfig is not enabled.\n");
eeconfig_init();
- eeconfig_write_rgblight_default();
+ eeconfig_update_rgblight_default();
}
rgblight_config.raw = eeconfig_read_rgblight();
if (!rgblight_config.mode) {
dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n");
- eeconfig_write_rgblight_default();
+ eeconfig_update_rgblight_default();
rgblight_config.raw = eeconfig_read_rgblight();
}
eeconfig_debug_rgblight(); // display current eeprom values
@@ -189,7 +189,7 @@ void rgblight_mode(uint8_t mode) {
} else {
rgblight_config.mode = mode;
}
- eeconfig_write_rgblight(rgblight_config.raw);
+ eeconfig_update_rgblight(rgblight_config.raw);
dprintf("rgblight mode: %u\n", rgblight_config.mode);
if (rgblight_config.mode == 1) {
rgblight_timer_disable();
@@ -206,7 +206,7 @@ void rgblight_mode(uint8_t mode) {
void rgblight_toggle(void) {
rgblight_config.enable ^= 1;
- eeconfig_write_rgblight(rgblight_config.raw);
+ eeconfig_update_rgblight(rgblight_config.raw);
dprintf("rgblight toggle: rgblight_config.enable = %u\n", rgblight_config.enable);
if (rgblight_config.enable) {
rgblight_mode(rgblight_config.mode);
@@ -299,7 +299,7 @@ void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val){
rgblight_config.hue = hue;
rgblight_config.sat = sat;
rgblight_config.val = val;
- eeconfig_write_rgblight(rgblight_config.raw);
+ eeconfig_update_rgblight(rgblight_config.raw);
dprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
}
}
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index 9e1562328f..37e207578c 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -66,8 +66,8 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
#define EECONFIG_RGBLIGHT (uint8_t *)7
uint32_t eeconfig_read_rgblight(void);
-void eeconfig_write_rgblight(uint32_t val);
-void eeconfig_write_rgblight_default(void);
+void eeconfig_update_rgblight(uint32_t val);
+void eeconfig_update_rgblight_default(void);
void eeconfig_debug_rgblight(void);
void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1);