aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/rgblight.c
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/rgblight.c
parent9828aba2a12f03fccbc1095bc8e4918ae58fa31b (diff)
downloadfirmware-620ac4b260fa663d12b11a0b15ac50379523c125.tar.gz
firmware-620ac4b260fa663d12b11a0b15ac50379523c125.tar.bz2
firmware-620ac4b260fa663d12b11a0b15ac50379523c125.zip
Update functions used to write to EEPROM
Diffstat (limited to 'quantum/rgblight.c')
-rw-r--r--quantum/rgblight.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 2215cf5cd..5623c65de 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);
}
}