diff options
author | Joel Challis <git@zvecr.com> | 2022-10-08 23:30:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-09 09:30:51 +1100 |
commit | 48093000e1a8fbe7fc25a43aea3f75913a634d53 (patch) | |
tree | 5b864c2fa7601078da657db2b560bdfbc35225c4 /keyboards/duck/jetfire | |
parent | 85dc473faafbb9370abbd69bb0c08da3dea87386 (diff) |
Various keyboard fixes (#18649)
Diffstat (limited to 'keyboards/duck/jetfire')
-rw-r--r-- | keyboards/duck/jetfire/indicator_leds.h | 2 | ||||
-rw-r--r-- | keyboards/duck/jetfire/jetfire.c | 61 |
2 files changed, 9 insertions, 54 deletions
diff --git a/keyboards/duck/jetfire/indicator_leds.h b/keyboards/duck/jetfire/indicator_leds.h index 695e1db6d4..d94709d1cb 100644 --- a/keyboards/duck/jetfire/indicator_leds.h +++ b/keyboards/duck/jetfire/indicator_leds.h @@ -6,6 +6,6 @@ void backlight_init_ports(void); void backlight_set_state(bool cfg[7]); void backlight_update_state(void); void backlight_toggle_rgb(bool enabled); -void backlight_set_rgb(uint8_t cfg[17][3]); +void backlight_set_rgb(uint8_t cfg[RGBLED_NUM][3]); void backlight_set(uint8_t level); void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); diff --git a/keyboards/duck/jetfire/jetfire.c b/keyboards/duck/jetfire/jetfire.c index 9bb02ca22c..d648287156 100644 --- a/keyboards/duck/jetfire/jetfire.c +++ b/keyboards/duck/jetfire/jetfire.c @@ -44,61 +44,16 @@ uint8_t backlight_state_led = 1<<STATE_LED_LAYER_0; void backlight_toggle_rgb(bool enabled) { + uint8_t rgb[RGBLED_NUM][3] = { 0 }; + if(enabled) { - uint8_t rgb[RGBLED_NUM][3] = { - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b} - }; - backlight_set_rgb(rgb); - } else { - uint8_t rgb[RGBLED_NUM][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} - }; - backlight_set_rgb(rgb); + for(uint8_t i = 0; i < RGBLED_NUM; ++i) { + rgb[i][0] = backlight_rgb_r; + rgb[i][1] = backlight_rgb_g; + rgb[i][2] = backlight_rgb_b; + } } + backlight_set_rgb(rgb); } void backlight_set_rgb(uint8_t cfg[RGBLED_NUM][3]) |