From 751719e6cb547db753b2f33f06ee6fa61607d544 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 29 May 2018 08:05:22 -0700 Subject: 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! --- quantum/rgblight.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'quantum/rgblight.h') diff --git a/quantum/rgblight.h b/quantum/rgblight.h index a6593af98b..569424506b 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); -- cgit v1.2.3