diff --git a/common/backlight.c b/common/backlight.c index c3001dd0..bb93d6db 100644 --- a/common/backlight.c +++ b/common/backlight.c @@ -106,6 +106,14 @@ void backlight_step(void) } void backlight_level(uint8_t level) +{ + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + eeconfig_write_backlight(backlight_config.raw); + backlight_set(backlight_config.level); +} + +void backlight_xor(uint8_t level) { backlight_config.level ^= level; backlight_config.enable = !!backlight_config.level; diff --git a/common/backlight.h b/common/backlight.h index 525ec8bb..973d6d80 100644 --- a/common/backlight.h +++ b/common/backlight.h @@ -36,5 +36,6 @@ void backlight_toggle(void); void backlight_step(void); void backlight_set(uint8_t level); void backlight_level(uint8_t level); +void backlight_xor(uint8_t level); #endif