Do not return negative sleeptimer values

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27774 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Chicoine 2010-08-11 23:36:35 +00:00
parent 113764d9c0
commit 209020ceb1

View file

@ -218,7 +218,7 @@ void set_sleep_timer(int seconds)
int get_sleep_timer(void) int get_sleep_timer(void)
{ {
if (sleeptimer_active) if (sleeptimer_active && (sleeptimer_endtick >= current_tick))
return (sleeptimer_endtick - current_tick) / HZ; return (sleeptimer_endtick - current_tick) / HZ;
else else
return 0; return 0;