From 209020ceb1403ff2d3d50c3a9cc82e9d35b885f5 Mon Sep 17 00:00:00 2001 From: Michael Chicoine Date: Wed, 11 Aug 2010 23:36:35 +0000 Subject: [PATCH] Do not return negative sleeptimer values git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27774 a1c6a512-1295-4272-9138-f99709370657 --- firmware/powermgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;