diff options
author | fishsoupisgood <github@madingley.org> | 2020-10-02 11:10:08 +0100 |
---|---|---|
committer | fishsoupisgood <github@madingley.org> | 2020-10-02 11:10:08 +0100 |
commit | ee079a41f1450ef567e15699275596ebe058236a (patch) | |
tree | 225f59e41a436fc3b22cbfe04e214a6e371e82f2 /quantum/rgblight.c | |
parent | 9cd522d3814baf2fd12839c5e5ff2a98b4d823b4 (diff) | |
download | firmware-ee079a41f1450ef567e15699275596ebe058236a.tar.gz firmware-ee079a41f1450ef567e15699275596ebe058236a.tar.bz2 firmware-ee079a41f1450ef567e15699275596ebe058236a.zip |
Diffstat (limited to 'quantum/rgblight.c')
-rw-r--r-- | quantum/rgblight.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 76bb6eb8c..bba50037e 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -551,9 +551,9 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { rgblight_set(); } -void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index) { +int rgblight_setrgb_at_noupdate(uint8_t r, uint8_t g, uint8_t b, uint8_t index) { if (!rgblight_config.enable || index >= RGBLED_NUM) { - return; + return -1; } led[index].r = r; @@ -562,6 +562,13 @@ void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index) { #ifdef RGBW led[index].w = 0; #endif + return 0; +} + + +void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index) { + if (rgblight_setrgb_at_noupdate(r, g, b, index)) + return; rgblight_set(); } |