diff options
author | Ryan <fauxpark@gmail.com> | 2023-12-05 22:49:14 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 22:49:14 +1100 |
commit | 17f36a21bfc340e4715c5849e4d0c537820e7cbe (patch) | |
tree | 88a9604026cd94de52eaa34f6a93e2e8d975659e /keyboards/matrix/noah | |
parent | 2acb426b8e51acd4ba16475c2132023cbb59b71a (diff) |
Rework RGBLight driver system (#22529)
Diffstat (limited to 'keyboards/matrix/noah')
-rw-r--r-- | keyboards/matrix/noah/noah.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/keyboards/matrix/noah/noah.c b/keyboards/matrix/noah/noah.c index 8246da809c..35a55d03b6 100644 --- a/keyboards/matrix/noah/noah.c +++ b/keyboards/matrix/noah/noah.c @@ -22,45 +22,42 @@ extern rgblight_config_t rgblight_config; #endif rgb_led_t noah_leds[RGBLED_NUM]; static bool noah_led_mode = false; -void rgblight_set(void) { +void setleds_custom(rgb_led_t *ledarray, uint16_t num_leds) { memset(&noah_leds[0], 0, sizeof(noah_leds)); 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; + ledarray[i].r = 0; + ledarray[i].g = 0; + ledarray[i].b = 0; } } if (noah_led_mode) { led_t led_state = host_keyboard_led_state(); if (led_state.caps_lock) { - noah_leds[0] = led[0]; + noah_leds[0] = ledarray[0]; } if (led_state.scroll_lock) { - noah_leds[1] = led[1]; + noah_leds[1] = ledarray[1]; } if (led_state.num_lock) { - noah_leds[2] = led[2]; + noah_leds[2] = ledarray[2]; } for (int32_t i = 0; i < 4; i++) { if(layer_state_is(i+1)) { - noah_leds[i + 3] = led[i + 3]; + noah_leds[i + 3] = ledarray[i + 3]; } } } else { - memcpy(&noah_leds[0], &led[0], sizeof(noah_leds)); + memcpy(&noah_leds[0], &ledarray[0], sizeof(noah_leds)); } ws2812_setleds(noah_leds, RGBLED_NUM); } -#endif -void matrix_scan_kb(void) { -#ifdef RGBLIGHT_ENABLE - rgblight_task(); +const rgblight_driver_t rgblight_driver = { + .setleds = setleds_custom, +}; #endif - matrix_scan_user(); -} #ifdef RGB_MATRIX_ENABLE const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = { |