summaryrefslogtreecommitdiff
path: root/firmware/backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r--firmware/backlight.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 0f66fbf574..19e6933fca 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -631,13 +631,13 @@ void backlight_off(void)
631 queue_post(&backlight_queue, BACKLIGHT_OFF, 0); 631 queue_post(&backlight_queue, BACKLIGHT_OFF, 0);
632} 632}
633 633
634/* returns true when the backlight is on OR when it's set to always off */ 634/* returns true when the backlight is on,
635bool is_backlight_on(void) 635 * and optionally when it's set to always off. */
636bool is_backlight_on(bool ignore_always_off)
636{ 637{
637 if (backlight_timer || backlight_timeout <= 0) 638 return (backlight_timer > 0) /* countdown */
638 return true; 639 || (backlight_timeout == 0) /* always on */
639 else 640 || ((backlight_timeout < 0) && !ignore_always_off);
640 return false;
641} 641}
642 642
643/* return value in ticks; 0 means always on, <0 means always off */ 643/* return value in ticks; 0 means always on, <0 means always off */
@@ -752,13 +752,13 @@ int remote_backlight_get_current_timeout(void)
752 return remote_backlight_timeout; 752 return remote_backlight_timeout;
753} 753}
754 754
755/* returns true when the backlight is on OR when it's set to always off */ 755/* returns true when the backlight is on, and
756bool is_remote_backlight_on(void) 756 * optionally when it's set to always off */
757bool is_remote_backlight_on(bool ignore_always_off)
757{ 758{
758 if (remote_backlight_timer != 0 || remote_backlight_timeout <= 0) 759 return (remote_backlight_timer > 0) /* countdown */
759 return true; 760 || (remote_backlight_timeout == 0) /* always on */
760 else 761 || ((remote_backlight_timeout < 0) && !ignore_always_off);
761 return false;
762} 762}
763 763
764#endif /* HAVE_REMOTE_LCD */ 764#endif /* HAVE_REMOTE_LCD */