From 89bdc9fb72ee62947654edc7fea44f088e3d4c68 Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Sun, 3 Aug 2014 11:36:41 +0900 Subject: [PATCH] Change backlight_level to backlight_xor --- common/backlight.c | 8 ++++++++ common/backlight.h | 1 + 2 files changed, 9 insertions(+) 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