diff --git a/app/include/zmk/rgb_underglow.h b/app/include/zmk/rgb_underglow.h index be0ef252290..540d6595dd0 100644 --- a/app/include/zmk/rgb_underglow.h +++ b/app/include/zmk/rgb_underglow.h @@ -6,6 +6,9 @@ #pragma once +#include +#include + struct zmk_led_hsb { uint16_t h; uint8_t s; @@ -27,3 +30,4 @@ int zmk_rgb_underglow_change_sat(int direction); int zmk_rgb_underglow_change_brt(int direction); int zmk_rgb_underglow_change_spd(int direction); int zmk_rgb_underglow_set_hsb(struct zmk_led_hsb color); +__attribute__((weak)) void zmk_rgb_underglow_update_hook(struct led_rgb *pixels, size_t count); diff --git a/app/src/rgb_underglow.c b/app/src/rgb_underglow.c index 3453fb44e0d..05c1e487f02 100644 --- a/app/src/rgb_underglow.c +++ b/app/src/rgb_underglow.c @@ -130,6 +130,8 @@ static struct led_rgb hsb_to_rgb(struct zmk_led_hsb hsb) { return rgb; } +void zmk_rgb_underglow_update_hook(struct led_rgb *pixels, size_t count) { /* no op */ } + static void zmk_rgb_underglow_effect_solid(void) { for (int i = 0; i < STRIP_NUM_PIXELS; i++) { pixels[i] = hsb_to_rgb(hsb_scale_min_max(state.color)); @@ -191,6 +193,7 @@ static void zmk_rgb_underglow_tick(struct k_work *work) { break; } + zmk_rgb_underglow_update_hook(pixels, STRIP_NUM_PIXELS); int err = led_strip_update_rgb(led_strip, pixels, STRIP_NUM_PIXELS); if (err < 0) { LOG_ERR("Failed to update the RGB strip (%d)", err);