diff options
| author | Drashna Jaelre <drashna@live.com> | 2018-05-29 08:05:22 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-05-29 11:05:22 -0400 |
| commit | 751719e6cb547db753b2f33f06ee6fa61607d544 (patch) | |
| tree | 456437ab1d6c051e73ccd2e92d4fb1445d496ca8 /quantum/rgblight.h | |
| parent | 034a25aedf5e0ddba2b05f4b3534c1522330d5cd (diff) | |
| download | qmk_firmware-751719e6cb547db753b2f33f06ee6fa61607d544.tar.gz qmk_firmware-751719e6cb547db753b2f33f06ee6fa61607d544.zip | |
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.h | 9 |
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); | |||
| 134 | 134 | ||
| 135 | void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); | 135 | void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); |
| 136 | void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); | 136 | void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); |
| 137 | |||
| 137 | void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); | 138 | void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); |
| 139 | void rgblight_mode_noeeprom(uint8_t mode); | ||
| 140 | void rgblight_toggle_noeeprom(void); | ||
| 141 | void rgblight_enable_noeeprom(void); | ||
| 142 | void rgblight_disable_noeeprom(void); | ||
| 143 | |||
| 144 | void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); | ||
| 145 | void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); | ||
| 146 | |||
| 138 | 147 | ||
| 139 | #define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) | 148 | #define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) |
| 140 | void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); | 149 | void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); |
