forked from mirrors/qmk_userspace
backlight breathing overhaul (#2187)
* add breathing to bananasplit * backlight breathing overhaul * fix the backlight_tick thing. * fix for vision_division backlight * fix a few keymaps and probably break breathing for some weirdly set-up boards. * remove BL_x keycodes because they made unreasonable assumptions * some fixes for BL keycodes * integer cie lightness scaling * use cie lightness for non-breathing backlight and make breathing able to reach true max brightness
This commit is contained in:
parent
d6215ad6af
commit
4931510ad3
25 changed files with 285 additions and 329 deletions
|
@ -61,6 +61,8 @@ void backlight_decrease(void)
|
|||
void backlight_toggle(void)
|
||||
{
|
||||
backlight_config.enable ^= 1;
|
||||
if (backlight_config.raw == 1) // enabled but level = 0
|
||||
backlight_config.level = 1;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
dprintf("backlight toggle: %u\n", backlight_config.enable);
|
||||
backlight_set(backlight_config.enable ? backlight_config.level : 0);
|
||||
|
@ -81,7 +83,9 @@ void backlight_step(void)
|
|||
|
||||
void backlight_level(uint8_t level)
|
||||
{
|
||||
backlight_config.level ^= level;
|
||||
if (level > BACKLIGHT_LEVELS)
|
||||
level = BACKLIGHT_LEVELS;
|
||||
backlight_config.level = level;
|
||||
backlight_config.enable = !!backlight_config.level;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
backlight_set(backlight_config.level);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue