From 589d99b448e6085513799fbb183f6389d4df408d Mon Sep 17 00:00:00 2001 From: Ralf Schmitt Date: Tue, 8 Apr 2014 21:02:46 +0200 Subject: New macro: ACTION_BACKLIGHT_LEVEL(level) To have full control of the backlight level. --- common/backlight.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common/backlight.c') diff --git a/common/backlight.c b/common/backlight.c index 00dc04a07..558ad9b01 100644 --- a/common/backlight.c +++ b/common/backlight.c @@ -75,3 +75,11 @@ void backlight_step(void) dprintf("backlight step: %u\n", backlight_config.level); backlight_set(backlight_config.level); } + +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); +} -- cgit v1.2.3-24-g4f1b