Skip to content

Commit

Permalink
Clean up RGB LED type (#21859)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored Sep 4, 2023
1 parent 1e3095f commit 41bd4e3
Show file tree
Hide file tree
Showing 63 changed files with 222 additions and 243 deletions.
6 changes: 3 additions & 3 deletions docs/feature_rgblight.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 370,9 @@ If you need to change your RGB lighting in code, for example in a macro to chang

Example:
```c
sethsv(HSV_WHITE, (LED_TYPE *)&led[0]); // led 0
sethsv(HSV_RED, (LED_TYPE *)&led[1]); // led 1
sethsv(HSV_GREEN, (LED_TYPE *)&led[2]); // led 2
sethsv(HSV_WHITE, (rgb_led_t *)&led[0]); // led 0
sethsv(HSV_RED, (rgb_led_t *)&led[1]); // led 1
sethsv(HSV_GREEN, (rgb_led_t *)&led[2]); // led 2
rgblight_set(); // Utility functions do not call rgblight_set() automatically, so they need to be called explicitly.
```
Expand Down
8 changes: 4 additions & 4 deletions drivers/led/apa102.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 61,18 @@ void static apa102_end_frame(uint16_t num_leds);
void static apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness);
void static apa102_send_byte(uint8_t byte);

void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds) {
LED_TYPE *end = start_led num_leds;
void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds) {
rgb_led_t *end = start_led num_leds;

apa102_start_frame();
for (LED_TYPE *led = start_led; led < end; led ) {
for (rgb_led_t *led = start_led; led < end; led ) {
apa102_send_frame(led->r, led->g, led->b, apa102_led_brightness);
}
apa102_end_frame(num_leds);
}

// Overwrite the default rgblight_call_driver to use apa102 driver
void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) {
void rgblight_call_driver(rgb_led_t *start_led, uint8_t num_leds) {
apa102_setleds(start_led, num_leds);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/led/apa102.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 37,5 @@ extern uint8_t apa102_led_brightness;
* - Set the data-out pin as output
* - Send out the LED data
*/
void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds);
void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds);
void apa102_set_brightness(uint8_t brightness);
2 changes: 1 addition & 1 deletion drivers/ws2812.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 73,4 @@
* - Send out the LED data
* - Wait 50us to reset the LEDs
*/
void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
void ws2812_setleds(rgb_led_t *ledarray, uint16_t number_of_leds);
2 changes: 1 addition & 1 deletion keyboards/1k/keymaps/default/rgblite.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 7,7 @@
#include "color.h"

static inline void rgblite_setrgb(RGB rgb) {
LED_TYPE leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
rgb_led_t leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
ws2812_setleds(leds, RGBLED_NUM);
}

Expand Down
2 changes: 1 addition & 1 deletion keyboards/1k/keymaps/media/rgblite.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 7,7 @@
#include "color.h"

static inline void rgblite_setrgb(RGB rgb) {
LED_TYPE leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
rgb_led_t leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
ws2812_setleds(leds, RGBLED_NUM);
}

Expand Down
2 changes: 1 addition & 1 deletion keyboards/1upkeyboards/super16/keymaps/15game/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 85,7 @@ uint8_t remap[16] = {
void refresh_leds(void) {
for (uint8_t index = 0; index < 16; index) {
uint8_t tile = tiles[index];
setrgb(r[tile], g[tile], b[tile], (LED_TYPE *)&led[remap[index]]);
setrgb(r[tile], g[tile], b[tile], (rgb_led_t *)&led[remap[index]]);
}
rgblight_set();
}
Expand Down
8 changes: 4 additions & 4 deletions keyboards/25keys/zinc/keymaps/ginjake/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 341,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
//キー毎に時間差で色が変化していく
if (aqours_next_color_timer_count % NEXT_CHANGE_TARGET_TIME == 0) {
if (target_col < MATRIX_COLS) {
sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[target_col]);
sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[11 - target_col]);
sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[12 target_col]);
sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[23 - target_col]);
sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (rgb_led_t *)&led[target_col]);
sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (rgb_led_t *)&led[11 - target_col]);
sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (rgb_led_t *)&led[12 target_col]);
sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (rgb_led_t *)&led[23 - target_col]);
target_col ;
rgblight_set();
}
Expand Down
6 changes: 3 additions & 3 deletions keyboards/clueboard/66/keymaps/magicmonty/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 172,7 @@ void clueboard_set_midi_led(uint8_t base_oct, uint8_t val)
uint8_t sat = 255;

for (uint8_t i = 0; i < RGBLED_NUM; i ) {
sethsv(oct_hues[base_oct], sat, val, (LED_TYPE *)&led[i]);
sethsv(oct_hues[base_oct], sat, val, (rgb_led_t *)&led[i]);
}

uint8_t next_oct = base_oct < MAX_OCT ? base_oct 1 : base_oct;
Expand All @@ -183,11 183,11 @@ void clueboard_set_midi_led(uint8_t base_oct, uint8_t val)


for (uint8_t i = 0; i < 3; i ) {
sethsv(next_hue, next_sat, next_val, (LED_TYPE *)&led[i]);
sethsv(next_hue, next_sat, next_val, (rgb_led_t *)&led[i]);
}

for (uint8_t i = 11; i < 14; i ) {
sethsv(next_hue, next_sat, next_val, (LED_TYPE *)&led[i]);
sethsv(next_hue, next_sat, next_val, (rgb_led_t *)&led[i]);
}

rgblight_set();
Expand Down
4 changes: 2 additions & 2 deletions keyboards/dp60/keymaps/indicator/indicator.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 70,9 @@ void keyboard_post_init_user(void) {

extern rgblight_config_t rgblight_config;
extern void rgblight_layers_write(void);
extern void indicator_write(LED_TYPE *start_led, uint8_t num_leds);
extern void indicator_write(rgb_led_t *start_led, uint8_t num_leds);

void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds)
void rgblight_call_driver(rgb_led_t *start_led, uint8_t num_leds)
{
ws2812_setleds(start_led, RGBLED_NUM-RGB_INDICATOR_NUM);

Expand Down
2 changes: 1 addition & 1 deletion keyboards/dp60/keymaps/indicator/led_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 20,7 @@
#define ws2812_setleds_pin indicator_setleds_pin
#include "ws2812_bitbang.c"

void indicator_write(LED_TYPE *start_led, uint8_t num_leds)
void indicator_write(rgb_led_t *start_led, uint8_t num_leds)
{
indicator_setleds(start_led, num_leds);
}
2 changes: 1 addition & 1 deletion keyboards/ergodox_ez/led_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

# include "ergodox_ez.h"

void rgblight_call_driver(LED_TYPE *led, uint8_t led_num) {
void rgblight_call_driver(rgb_led_t *led, uint8_t led_num) {
i2c_init();
i2c_start(0x84, ERGODOX_EZ_I2C_TIMEOUT);
int i = 0;
Expand Down
20 changes: 10 additions & 10 deletions keyboards/handwired/lovelive9/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 154,15 @@ int aqours_color_v[] = {255, 255, 255, 255, 255, 255, 200, 255, 255};

void LED_default_set(void) {

sethsv(aqours_color_h[2], aqours_color_s[2], aqours_color_v[2], (LED_TYPE *)&led[0]);
sethsv(aqours_color_h[7], aqours_color_s[7], aqours_color_v[7], (LED_TYPE *)&led[1]);
sethsv(aqours_color_h[1], aqours_color_s[1], aqours_color_v[1], (LED_TYPE *)&led[2]);
sethsv(aqours_color_h[5], aqours_color_s[5], aqours_color_v[5], (LED_TYPE *)&led[3]);
sethsv(aqours_color_h[8], aqours_color_s[8], aqours_color_v[8], (LED_TYPE *)&led[4]);
sethsv(aqours_color_h[6], aqours_color_s[6], aqours_color_v[6], (LED_TYPE *)&led[5]);
sethsv(aqours_color_h[0], aqours_color_s[0], aqours_color_v[0], (LED_TYPE *)&led[6]);
sethsv(aqours_color_h[4], aqours_color_s[4], aqours_color_v[4], (LED_TYPE *)&led[7]);
sethsv(aqours_color_h[3], aqours_color_s[3], aqours_color_v[3], (LED_TYPE *)&led[8]);
sethsv(aqours_color_h[2], aqours_color_s[2], aqours_color_v[2], (rgb_led_t *)&led[0]);
sethsv(aqours_color_h[7], aqours_color_s[7], aqours_color_v[7], (rgb_led_t *)&led[1]);
sethsv(aqours_color_h[1], aqours_color_s[1], aqours_color_v[1], (rgb_led_t *)&led[2]);
sethsv(aqours_color_h[5], aqours_color_s[5], aqours_color_v[5], (rgb_led_t *)&led[3]);
sethsv(aqours_color_h[8], aqours_color_s[8], aqours_color_v[8], (rgb_led_t *)&led[4]);
sethsv(aqours_color_h[6], aqours_color_s[6], aqours_color_v[6], (rgb_led_t *)&led[5]);
sethsv(aqours_color_h[0], aqours_color_s[0], aqours_color_v[0], (rgb_led_t *)&led[6]);
sethsv(aqours_color_h[4], aqours_color_s[4], aqours_color_v[4], (rgb_led_t *)&led[7]);
sethsv(aqours_color_h[3], aqours_color_s[3], aqours_color_v[3], (rgb_led_t *)&led[8]);

rgblight_set();

Expand All @@ -171,7 171,7 @@ void LED_default_set(void) {

void LED_layer_set(int aqours_index) {
for (int c = 0; c < 9; c ) {
sethsv(aqours_color_h[aqours_index], aqours_color_s[aqours_index], aqours_color_v[aqours_index], (LED_TYPE *)&led[c]);
sethsv(aqours_color_h[aqours_index], aqours_color_s[aqours_index], aqours_color_v[aqours_index], (rgb_led_t *)&led[c]);
}
rgblight_set();
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/handwired/promethium/rgbsps.c
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@
#include "ws2812.h"
#include "rgbsps.h"

cRGB led[RGBSPS_NUM];
rgb_led_t led[RGBSPS_NUM];

void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b) {
led[index].r = r;
Expand Down
14 changes: 7 additions & 7 deletions keyboards/hineybush/hbcp/hbcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 49,19 @@ bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
if (led_state.caps_lock) {
sethsv_raw(HSV_CAPS, (LED_TYPE *)&led[0]);
sethsv_raw(HSV_CAPS, (rgb_led_t *)&led[0]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[0]);
sethsv(HSV_BLACK, (rgb_led_t *)&led[0]);
}
if (led_state.num_lock) {
sethsv_raw(HSV_NLCK, (LED_TYPE *)&led[1]);
sethsv_raw(HSV_NLCK, (rgb_led_t *)&led[1]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[1]);
sethsv(HSV_BLACK, (rgb_led_t *)&led[1]);
}
if (led_state.scroll_lock) {
sethsv_raw(HSV_SCRL, (LED_TYPE *)&led[2]);
sethsv_raw(HSV_SCRL, (rgb_led_t *)&led[2]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[2]);
sethsv(HSV_BLACK, (rgb_led_t *)&led[2]);
}
rgblight_set();
}
Expand All @@ -83,7 83,7 @@ void keyboard_post_init_user(void) {

__attribute__ ((weak))
void hbcp_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end) {
LED_TYPE tmp_led;
rgb_led_t tmp_led;
sethsv_raw(hue, sat, val, &tmp_led);
for (uint8_t i = start; i < end; i ) {
led[i] = tmp_led;
Expand Down
12 changes: 6 additions & 6 deletions keyboards/hineybush/hbcp/keymaps/hiney/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 79,19 @@ void matrix_scan_user(void) {
// The first three LEDs are used as indicators for CAPS_LOCK, NUM_LOCK and SCROLL_LOCK.
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
sethsv_raw(HSV_SOFT_RED, (LED_TYPE *)&led[0]);
sethsv_raw(HSV_SOFT_RED, (rgb_led_t *)&led[0]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[0]);
sethsv(HSV_BLACK, (rgb_led_t *)&led[0]);
}
if (led_state.num_lock) {
sethsv_raw(HSV_WARM_WHITE, (LED_TYPE *)&led[1]);
sethsv_raw(HSV_WARM_WHITE, (rgb_led_t *)&led[1]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[1]);
sethsv(HSV_BLACK, (rgb_led_t *)&led[1]);
}
if (led_state.scroll_lock) {
sethsv_raw(HSV_SOFT_BLUE, (LED_TYPE *)&led[2]);
sethsv_raw(HSV_SOFT_BLUE, (rgb_led_t *)&led[2]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[2]);
sethsv(HSV_BLACK, (rgb_led_t *)&led[2]);
}
rgblight_set();
return false;
Expand Down
22 changes: 11 additions & 11 deletions keyboards/ibm/model_m/mschwingen/mschwingen.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 39,26 @@ static uint8_t isRecording = 0;
# if RGBLED_NUM < 3
# error we need at least 3 RGB LEDs!
# endif
static cRGB led[RGBLED_NUM] = {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}};
static rgb_led_t led[RGBLED_NUM] = {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}};

# define BRIGHT 32
# define DIM 6

static const cRGB black = {.r = 0, .g = 0, .b = 0};
static const rgb_led_t black = {.r = 0, .g = 0, .b = 0};

static const __attribute__((unused)) cRGB green = {.r = 0, .g = BRIGHT, .b = 0};
static const __attribute__((unused)) cRGB lgreen = {.r = 0, .g = DIM, .b = 0};
static const __attribute__((unused)) rgb_led_t green = {.r = 0, .g = BRIGHT, .b = 0};
static const __attribute__((unused)) rgb_led_t lgreen = {.r = 0, .g = DIM, .b = 0};

static const __attribute__((unused)) cRGB red = {.r = BRIGHT, .g = 0, .b = 0};
static const __attribute__((unused)) cRGB lred = {.r = DIM, .g = 0, .b = 0};
static const __attribute__((unused)) rgb_led_t red = {.r = BRIGHT, .g = 0, .b = 0};
static const __attribute__((unused)) rgb_led_t lred = {.r = DIM, .g = 0, .b = 0};

static const __attribute__((unused)) cRGB blue = {.r = 0, .g = 0, .b = BRIGHT};
static const __attribute__((unused)) cRGB lblue = {.r = 0, .g = 0, .b = DIM};
static const __attribute__((unused)) rgb_led_t blue = {.r = 0, .g = 0, .b = BRIGHT};
static const __attribute__((unused)) rgb_led_t lblue = {.r = 0, .g = 0, .b = DIM};

static const __attribute__((unused)) cRGB turq = {.r = 0, .g = BRIGHT, .b = BRIGHT};
static const __attribute__((unused)) cRGB lturq = {.r = 0, .g = DIM, .b = DIM};
static const __attribute__((unused)) rgb_led_t turq = {.r = 0, .g = BRIGHT, .b = BRIGHT};
static const __attribute__((unused)) rgb_led_t lturq = {.r = 0, .g = DIM, .b = DIM};

static const __attribute__((unused)) cRGB white = {.r = BRIGHT, .g = BRIGHT, .b = BRIGHT};
static const __attribute__((unused)) rgb_led_t white = {.r = BRIGHT, .g = BRIGHT, .b = BRIGHT};

static led_t led_state;
static uint8_t layer;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 162,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/** Set just 4 LEDs closest to the user. Slightly less annoying to bystanders.*/
void rgbflag(uint8_t r, uint8_t g, uint8_t b, uint8_t rr, uint8_t gg, uint8_t bb) {
LED_TYPE *target_led = user_rgb_mode ? shadowed_led : led;
rgb_led_t *target_led = user_rgb_mode ? shadowed_led : led;
for (int i = 0; i < RGBLED_NUM; i ) {
switch (i) {
case 12: case 13:
Expand Down
2 changes: 1 addition & 1 deletion keyboards/keebio/levinson/keymaps/xtonhasvim/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#define C_ORG 0xFF, 0x93, 0x00

void rgbflag(uint8_t r, uint8_t g, uint8_t b, uint8_t rr, uint8_t gg, uint8_t bb) {
LED_TYPE *target_led = user_rgb_mode ? shadowed_led : led;
rgb_led_t *target_led = user_rgb_mode ? shadowed_led : led;
for (int i = 0; i < RGBLED_NUM; i ) {
switch (i) {
case 10: case 11:
Expand Down
4 changes: 2 additions & 2 deletions keyboards/kingly_keys/ave/ortho/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 217,7 @@ void keyboard_post_init_user(void) {
rgblight_sethsv_noeeprom(50, 255, 100);
rgblight_mode_noeeprom(RGBLIGHT_EFFECT_BREATHING 2);
// Init the second LED to a static color:
setrgb(225, 185, 0, (LED_TYPE *)&led[1]);
setrgb(225, 185, 0, (rgb_led_t *)&led[1]);
rgblight_set();
#endif // RGBLIGHT_ENABLE
}
Expand All @@ -232,7 232,7 @@ layer_state_t layer_state_set_user(layer_state_t state){
if (layer_state_cmp(state, 3)) {
led1r = 200;
}
setrgb(led1r, led1g, led1b, (LED_TYPE *)&led[1]);
setrgb(led1r, led1g, led1b, (rgb_led_t *)&led[1]);
rgblight_set();
#endif //RGBLIGHT_ENABLE
return state;
Expand Down
4 changes: 2 additions & 2 deletions keyboards/kingly_keys/ave/staggered/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 217,7 @@ void keyboard_post_init_user(void) {
rgblight_sethsv_noeeprom(50, 255, 100);
rgblight_mode_noeeprom(RGBLIGHT_EFFECT_BREATHING 2);
// Init the second LED to a static color:
setrgb(225, 185, 0, (LED_TYPE *)&led[1]);
setrgb(225, 185, 0, (rgb_led_t *)&led[1]);
rgblight_set();
#endif // RGBLIGHT_ENABLE
}
Expand All @@ -232,7 232,7 @@ layer_state_t layer_state_set_user(layer_state_t state){
if (layer_state_cmp(state, 3)) {
led1r = 200;
}
setrgb(led1r, led1g, led1b, (LED_TYPE *)&led[1]);
setrgb(led1r, led1g, led1b, (rgb_led_t *)&led[1]);
rgblight_set();
#endif //RGBLIGHT_ENABLE
return state;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/kprepublic/bm60hsrgb/rev2/rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 148,7 @@ bool rgb_matrix_indicators_kb(void) {
// ==========================================================================

# if WS2812_LED_TOTAL > 0
LED_TYPE rgb_matrix_ws2812_array[WS2812_LED_TOTAL];
rgb_led_t rgb_matrix_ws2812_array[WS2812_LED_TOTAL];
# endif

static void rgb_matrix_driver_init(void) {
Expand Down
2 changes: 1 addition & 1 deletion keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 148,7 @@ bool rgb_matrix_indicators_kb(void) {
// ==========================================================================

# if WS2812_LED_TOTAL > 0
LED_TYPE rgb_matrix_ws2812_array[WS2812_LED_TOTAL];
rgb_led_t rgb_matrix_ws2812_array[WS2812_LED_TOTAL];
# endif

static void rgb_matrix_driver_init(void) {
Expand Down
2 changes: 1 addition & 1 deletion keyboards/kprepublic/bm60hsrgb_poker/rev2/rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 144,7 @@ bool rgb_matrix_indicators_kb(void) {
// ==========================================================================

# if WS2812_LED_TOTAL > 0
LED_TYPE rgb_matrix_ws2812_array[WS2812_LED_TOTAL];
rgb_led_t rgb_matrix_ws2812_array[WS2812_LED_TOTAL];
# endif

static void rgb_matrix_driver_init(void) {
Expand Down
6 changes: 3 additions & 3 deletions keyboards/manyboard/macro/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 41,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) {
case 0:
sethsv(HSV_WHITE, (LED_TYPE *)&led[0]);
sethsv(HSV_WHITE, (rgb_led_t *)&led[0]);
rgblight_set();
break;
case 1:
sethsv(HSV_GREEN, (LED_TYPE *)&led[0]);
sethsv(HSV_GREEN, (rgb_led_t *)&led[0]);
rgblight_set();
break;
case 2:
sethsv(HSV_BLUE, (LED_TYPE *)&led[0]);
sethsv(HSV_BLUE, (rgb_led_t *)&led[0]);
rgblight_set();
break;
}
Expand Down
Loading

0 comments on commit 41bd4e3

Please sign in to comment.