summaryrefslogtreecommitdiffstats
path: root/quantum/rgblight.h
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-05-29 17:05:22 +0200
committerJack Humbert <jack.humb@gmail.com>2018-05-29 17:05:22 +0200
commit751719e6cb547db753b2f33f06ee6fa61607d544 (patch)
tree456437ab1d6c051e73ccd2e92d4fb1445d496ca8 /quantum/rgblight.h
parent034a25aedf5e0ddba2b05f4b3534c1522330d5cd (diff)
downloadqmk_firmware-751719e6cb547db753b2f33f06ee6fa61607d544.tar.gz
qmk_firmware-751719e6cb547db753b2f33f06ee6fa61607d544.tar.xz
Add and fix _noeeprom functions to many of the RGB Underglow functions (#3070)
* And and fix _noeeprom functions to many of the RGB Underglow functions * Many functions are unnecessarily calling the eeprom write code. The toggle/enable is command is especially guilty of this, as it writes to EEPROM 3 times. But rgb mode writes twice, every time it's called. And init resets the rgb eeprom range and then writes back to it twice! * Fixed the rgblight_sethsv_noeeprom to work as expected, by moving a lot of the code to a helper function. * Added a noeeprom function for mode, enable, disable, and toggle functions. (didn't bother for increase/decrease stuff, and didn't add new keycodes) * Add to predefined colors list * Add new functions to manual/docs * Update RGB Sleep feature to use _noeeprom Because that's exactly what it should be doing, actually!
Diffstat (limited to 'quantum/rgblight.h')
-rw-r--r--quantum/rgblight.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index a6593af98..569424506 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -134,7 +134,16 @@ void rgb_matrix_decrease(void);
void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1);
void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1);
+
void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val);
+void rgblight_mode_noeeprom(uint8_t mode);
+void rgblight_toggle_noeeprom(void);
+void rgblight_enable_noeeprom(void);
+void rgblight_disable_noeeprom(void);
+
+void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom);
+void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom);
+
#define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF)
void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b);