aboutsummaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2020-10-02 11:10:08 +0100
committerfishsoupisgood <github@madingley.org>2020-10-02 11:10:08 +0100
commitee079a41f1450ef567e15699275596ebe058236a (patch)
tree225f59e41a436fc3b22cbfe04e214a6e371e82f2 /quantum
parent9cd522d3814baf2fd12839c5e5ff2a98b4d823b4 (diff)
downloadfirmware-ee079a41f1450ef567e15699275596ebe058236a.tar.gz
firmware-ee079a41f1450ef567e15699275596ebe058236a.tar.bz2
firmware-ee079a41f1450ef567e15699275596ebe058236a.zip
async handing of colourHEADmaster
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgblight.c11
-rw-r--r--quantum/rgblight.h1
2 files changed, 10 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();
}
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index c3a9e94b7..436d4d8bd 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -291,6 +291,7 @@ void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds);
void rgblight_set_effect_range(uint8_t start_pos, uint8_t num_leds);
/* direct operation */
+int rgblight_setrgb_at_noupdate(uint8_t r, uint8_t g, uint8_t b, uint8_t index);
void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index);
void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index);
void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8_t end);