Option to allow lighting layers when RGB Lighting is off (#9051)
This commit is contained in:
committed by
Drashna Jael're
parent
b9f8ad1b9a
commit
98e93c95ec
@@ -630,6 +630,13 @@ void rgblight_set_layer_state(uint8_t layer, bool enabled) {
|
|||||||
if (rgblight_status.timer_enabled == false) {
|
if (rgblight_status.timer_enabled == false) {
|
||||||
rgblight_mode_noeeprom(rgblight_config.mode);
|
rgblight_mode_noeeprom(rgblight_config.mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
|
||||||
|
// If not enabled, then nothing else will actually set the LEDs...
|
||||||
|
if (!rgblight_config.enable) {
|
||||||
|
rgblight_set();
|
||||||
|
}
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rgblight_get_layer_state(uint8_t layer) {
|
bool rgblight_get_layer_state(uint8_t layer) {
|
||||||
@@ -695,16 +702,11 @@ void rgblight_unblink_layers(void) {
|
|||||||
__attribute__((weak)) void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { ws2812_setleds(start_led, num_leds); }
|
__attribute__((weak)) void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { ws2812_setleds(start_led, num_leds); }
|
||||||
|
|
||||||
#ifndef RGBLIGHT_CUSTOM_DRIVER
|
#ifndef RGBLIGHT_CUSTOM_DRIVER
|
||||||
|
|
||||||
void rgblight_set(void) {
|
void rgblight_set(void) {
|
||||||
LED_TYPE *start_led;
|
LED_TYPE *start_led;
|
||||||
uint8_t num_leds = rgblight_ranges.clipping_num_leds;
|
uint8_t num_leds = rgblight_ranges.clipping_num_leds;
|
||||||
|
|
||||||
# ifdef RGBLIGHT_LAYERS
|
|
||||||
if (rgblight_layers != NULL) {
|
|
||||||
rgblight_layers_write();
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (!rgblight_config.enable) {
|
if (!rgblight_config.enable) {
|
||||||
for (uint8_t i = rgblight_ranges.effect_start_pos; i < rgblight_ranges.effect_end_pos; i++) {
|
for (uint8_t i = rgblight_ranges.effect_start_pos; i < rgblight_ranges.effect_end_pos; i++) {
|
||||||
led[i].r = 0;
|
led[i].r = 0;
|
||||||
@@ -715,6 +717,17 @@ void rgblight_set(void) {
|
|||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef RGBLIGHT_LAYERS
|
||||||
|
if (rgblight_layers != NULL
|
||||||
|
# ifndef RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
|
||||||
|
&& rgblight_config.enable
|
||||||
|
# endif
|
||||||
|
) {
|
||||||
|
rgblight_layers_write();
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef RGBLIGHT_LED_MAP
|
# ifdef RGBLIGHT_LED_MAP
|
||||||
LED_TYPE led0[RGBLED_NUM];
|
LED_TYPE led0[RGBLED_NUM];
|
||||||
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
|
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user