From ee079a41f1450ef567e15699275596ebe058236a Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Fri, 2 Oct 2020 11:10:08 +0100 Subject: async handing of colour --- keyboards/ymdk/ymd09_32a/ymd09_32a.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'keyboards/ymdk/ymd09_32a') diff --git a/keyboards/ymdk/ymd09_32a/ymd09_32a.c b/keyboards/ymdk/ymd09_32a/ymd09_32a.c index 870593e6a..62487e017 100644 --- a/keyboards/ymdk/ymd09_32a/ymd09_32a.c +++ b/keyboards/ymdk/ymd09_32a/ymd09_32a.c @@ -16,6 +16,7 @@ */ #include "ymd09_32a.h" +static int rgb_update=0; void raw_hid_receive( uint8_t *data, uint8_t length ) { @@ -23,12 +24,19 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) switch ( data[0] ) { case RAW_COMMAND_CHANGE_COLOR: // 0x05 0x04 0xLL 0xRR 0xGG 0xBB -// rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - rgblight_setrgb_at(data[2],data[3],data[4],data[1]); + rgblight_setrgb_at_noupdate(data[2],data[3],data[4],data[1]); + rgb_update=1; break; } } +void raw_hid_dispatch(void) +{ + if (!rgb_update) return; + rgb_update = 0; + rgblight_set(); +} + void keyboard_pre_init_kb(void) { led_init_ports(); keyboard_pre_init_user(); -- cgit v1.2.3