Skip to content

Commit

Permalink
Adapt to rgblight changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rhruiz committed Jun 8, 2024
1 parent e226fdc commit d2d3a08
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions users/rhruiz/rgblight/rgblight.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,7 @@ void rhruiz_rgblight_reset(void) {
void rhruiz_change_leds_to(uint16_t hue, uint8_t sat) {
rgblight_config_t eeprom_config;
eeprom_config.raw = eeconfig_read_rgblight();
rgb_led_t *ledp;

#ifdef RGBLIGHT_LED_MAP
rgb_led_t led0[RGBLIGHT_LED_COUNT];
for (uint8_t i = 0; i < RGBLIGHT_LED_COUNT; i++) {
led0[i] = led[pgm_read_byte(&led_map[i])];
}
ledp = led0;
#else
ledp = led;
#endif

for (uint8_t i = RGBLIGHT_LED_COUNT; i-- > 0;) {
sethsv(hue, sat, eeprom_config.val, (rgb_led_t *)&ledp[i]);
}

#ifdef RGBW
ws2812_setleds_rgbw(ledp, RGBLIGHT_LED_COUNT);
#else
ws2812_setleds(ledp, RGBLIGHT_LED_COUNT);
#endif
rgblight_sethsv_range(hue, sat, eeprom_config.val, 0, RGBLIGHT_LED_COUNT - 1);
}
#endif

0 comments on commit d2d3a08

Please sign in to comment.