summaryrefslogtreecommitdiff
path: root/common/backlight.c
diff options
context:
space:
mode:
authorRalf Schmitt <ralf@bunkertor.net>2014-04-08 21:02:46 +0200
committerRalf Schmitt <ralf@bunkertor.net>2014-04-08 21:02:46 +0200
commit589d99b448e6085513799fbb183f6389d4df408d (patch)
tree3d6f83a71ffe03a2855046de58ba7ae9095f0733 /common/backlight.c
parent5c63751790bca2d7e0c6f368bd446db8fe671848 (diff)
New macro: ACTION_BACKLIGHT_LEVEL(level)
To have full control of the backlight level.
Diffstat (limited to 'common/backlight.c')
-rw-r--r--common/backlight.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/backlight.c b/common/backlight.c
index 00dc04a075..558ad9b014 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);
+}