summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/backlight-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/backlight-unix.c')
-rw-r--r--firmware/target/hosted/backlight-unix.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/firmware/target/hosted/backlight-unix.c b/firmware/target/hosted/backlight-unix.c
index 28bda52b20..06da05e487 100644
--- a/firmware/target/hosted/backlight-unix.c
+++ b/firmware/target/hosted/backlight-unix.c
@@ -44,20 +44,28 @@ bool backlight_hw_init(void)
return true;
}
+static int last_bl = -1;
+
void backlight_hw_on(void)
{
+ if (last_bl != 1) {
#ifdef HAVE_LCD_ENABLE
- lcd_enable(true);
+ lcd_enable(true);
#endif
- sysfs_set_int(sysfs_bl_power, 0);
+ sysfs_set_int(sysfs_bl_power, 0);
+ last_bl = 1;
+ }
}
void backlight_hw_off(void)
{
- sysfs_set_int(sysfs_bl_power, 1);
+ if (last_bl != 0) {
+ sysfs_set_int(sysfs_bl_power, 1);
#ifdef HAVE_LCD_ENABLE
- lcd_enable(false);
+ lcd_enable(false);
#endif
+ last_bl = 0;
+ }
}
void backlight_hw_brightness(int brightness)