-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix retain brightness when val is changed while a layer is active #18426
Fix retain brightness when val is changed while a layer is active #18426
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please see the suggested change below, and please test this with RGBLIGHT_EFFECT_STATIC_GRADIENT
.
rgblight_status.base_mode = mode_base_table[rgblight_config.mode]; | ||
if (rgblight_config.mode == RGBLIGHT_MODE_STATIC_LIGHT) { | ||
// same static color | ||
LED_TYPE tmp_led; | ||
#ifdef RGBLIGHT_LAYERS_RETAIN_VAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think similar code is needed in the RGBLIGHT_MODE_STATIC_GRADIENT
case below, at line 580...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, RGBLIGHT_MODE_STATIC_GRADIENT
needs it too
I've made the requested changes and tested it with |
…k#18426) * Fix retain brightness when val is changed while a layer is active * Fix retain brightness for RGBLIGHT_MODE_STATIC_GRADIENT * Fix formatting
Description
If
RGBLIGHT_LAYERS_RETAIN_VAL
is defined while lighting layers are used,rgblight_layers_write()
checksrgblight_config.val
for the currently set brightness. However,rgblight_sethsv_eeprom_helper()
updatesrgblight_config.val
with the newval
after it callsrgblight_setrgb()
, which ultimately callsrgblight_layers_write()
. This means that if the brightness is changed while a lighting layer is active, the LEDs won't change to the new brightness until the lighting layer changes, or the HSV is changed again.Tested with Iris Rev. 3
Types of Changes
Issues Fixed or Closed by This PR
Checklist