summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/backlight.c9
-rw-r--r--firmware/export/backlight.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 97c9175a4b..a84fc8b280 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -137,7 +137,7 @@ static inline void __backlight_off(void)
137 137
138#if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) 138#if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER)
139 139
140const char backlight_timeout_value[19] = 140const signed char backlight_timeout_value[19] =
141{ 141{
142 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90 142 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90
143}; 143};
@@ -522,9 +522,10 @@ void backlight_off(void)
522 queue_post(&backlight_queue, BACKLIGHT_OFF, NULL); 522 queue_post(&backlight_queue, BACKLIGHT_OFF, NULL);
523} 523}
524 524
525/* returns true when the backlight is on OR when it's set to always off */
525bool is_backlight_on(void) 526bool is_backlight_on(void)
526{ 527{
527 if (backlight_timer || !backlight_get_current_timeout()) 528 if (backlight_timer || backlight_get_current_timeout() <= 0)
528 return true; 529 return true;
529 else 530 else
530 return false; 531 return false;
@@ -615,9 +616,11 @@ int remote_backlight_get_current_timeout(void)
615#endif 616#endif
616} 617}
617 618
619/* returns true when the backlight is on OR when it's set to always off */
618bool is_remote_backlight_on(void) 620bool is_remote_backlight_on(void)
619{ 621{
620 if (remote_backlight_timer != 0 || !remote_backlight_get_current_timeout()) 622 if (remote_backlight_timer != 0 ||
623 remote_backlight_get_current_timeout() <= 0)
621 return true; 624 return true;
622 else 625 else
623 return false; 626 return false;
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h
index 508d472381..c1a7ade38f 100644
--- a/firmware/export/backlight.h
+++ b/firmware/export/backlight.h
@@ -33,7 +33,7 @@ void backlight_set_fade_in(int index);
33void backlight_set_fade_out(int index); 33void backlight_set_fade_out(int index);
34#endif 34#endif
35void backlight_set_timeout_plugged(int index); 35void backlight_set_timeout_plugged(int index);
36extern const char backlight_timeout_value[]; 36extern const signed char backlight_timeout_value[];
37#else 37#else
38#define backlight_init() 38#define backlight_init()
39#endif 39#endif