summaryrefslogtreecommitdiffstats
path: root/common/backlight.c
diff options
context:
space:
mode:
authortmk <tmk@users.noreply.github.com>2014-04-09 03:02:53 +0200
committertmk <tmk@users.noreply.github.com>2014-04-09 03:02:53 +0200
commit894a387d1fd8c823b5339e524e1f9336601ce2ef (patch)
tree3d6f83a71ffe03a2855046de58ba7ae9095f0733 /common/backlight.c
parent5c63751790bca2d7e0c6f368bd446db8fe671848 (diff)
parent589d99b448e6085513799fbb183f6389d4df408d (diff)
downloadqmk_firmware-894a387d1fd8c823b5339e524e1f9336601ce2ef.tar.gz
qmk_firmware-894a387d1fd8c823b5339e524e1f9336601ce2ef.tar.xz
Merge pull request #110 from xauser/master
Enhanced Backlight Support
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 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);
+}