diff options
Diffstat (limited to 'keyboards/ergodox_ez/led_i2c.c')
-rw-r--r-- | keyboards/ergodox_ez/led_i2c.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/keyboards/ergodox_ez/led_i2c.c b/keyboards/ergodox_ez/led_i2c.c index 8c4f81c7b7..f5553a8b61 100644 --- a/keyboards/ergodox_ez/led_i2c.c +++ b/keyboards/ergodox_ez/led_i2c.c @@ -22,30 +22,11 @@ */ #ifdef RGBLIGHT_ENABLE -# include "ws2812.c" # include "ergodox_ez.h" extern rgblight_config_t rgblight_config; -void rgblight_set(void) { - if (!rgblight_config.enable) { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; -#ifdef RGBW - led[i].w = 0; -#endif - } - } - -#ifdef RGBW - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - convert_rgb_to_rgbw(&led[i]); - } -#endif - - uint8_t led_num = RGBLED_NUM; +void rgblight_call_driver(LED_TYPE *led, uint8_t led_num) { i2c_init(); i2c_start(0x84, ERGODOX_EZ_I2C_TIMEOUT); int i = 0; @@ -53,8 +34,8 @@ void rgblight_set(void) { // prevent right-half code from trying to bitbang all 30 // so with 30 LEDs, we count from 29 to 15 here, and the // other half does 0 to 14. - led_num = RGBLED_NUM / 2; - for (i = led_num + led_num - 1; i >= led_num; --i) + uint8_t half_led_num = RGBLED_NUM / 2; + for (i = half_led_num + half_led_num - 1; i >= half_led_num; --i) # elif defined(ERGODOX_LED_15_MIRROR) for (i = 0; i < led_num; ++i) # else // ERGDOX_LED_15 non-mirrored @@ -71,7 +52,7 @@ void rgblight_set(void) { } i2c_stop(); - ws2812_setleds(led, RGBLED_NUM); + ws2812_setleds(led, led_num); } |