summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMichael Chicoine <mc2739@gmail.com>2010-08-11 23:36:35 +0000
committerMichael Chicoine <mc2739@gmail.com>2010-08-11 23:36:35 +0000
commit209020ceb1403ff2d3d50c3a9cc82e9d35b885f5 (patch)
tree94f63fa88bf65ed4bcce0d559112d5c011d43eb6 /firmware
parent113764d9c0dad33beab8ece9a9073c8648bd9da6 (diff)
downloadrockbox-209020ceb1403ff2d3d50c3a9cc82e9d35b885f5.tar.gz
rockbox-209020ceb1403ff2d3d50c3a9cc82e9d35b885f5.tar.bz2
rockbox-209020ceb1403ff2d3d50c3a9cc82e9d35b885f5.zip
Do not return negative sleeptimer values
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27774 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-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;