summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/powermgmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 6ae2ca6150..6ebbce5423 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -218,7 +218,7 @@ void set_sleep_timer(int seconds)
int get_sleep_timer(void)
{
- if (sleeptimer_active)
+ if (sleeptimer_active && (sleeptimer_endtick >= current_tick))
return (sleeptimer_endtick - current_tick) / HZ;
else
return 0;