summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMarkus Braun <markus.braun@krawel.de>2002-08-07 13:36:52 +0000
committerMarkus Braun <markus.braun@krawel.de>2002-08-07 13:36:52 +0000
commitb1cb5348569497145b7daf3b40e69896cea97ddc (patch)
tree0d7cae30864aaba8fb693645aacb68caf270b984 /apps
parent709382c801254ba624c8e1ab5b63e637f2ed3b70 (diff)
downloadrockbox-b1cb5348569497145b7daf3b40e69896cea97ddc.zip
rockbox-b1cb5348569497145b7daf3b40e69896cea97ddc.tar.gz
rockbox-b1cb5348569497145b7daf3b40e69896cea97ddc.tar.bz2
rockbox-b1cb5348569497145b7daf3b40e69896cea97ddc.tar.xz
Using TIME_AFTER() macro to prevent wrap problem
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1595 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/status.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/status.c b/apps/status.c
index a41eab9..f88a552 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -34,15 +34,12 @@ static enum playmode current_mode = STATUS_STOP;
#ifdef HAVE_LCD_BITMAP
bool statusbar_enabled = true;
-long last_tick;
+long switch_tick;
bool plug_state;
#endif
void status_init(void)
{
-#ifdef HAVE_LCD_BITMAP
- last_tick = current_tick;
-#endif
status_set_playmode(STATUS_STOP);
}
@@ -138,9 +135,9 @@ void status_draw(void)
if(charger_inserted()) {
if(!charger_enabled)
plug_state=true;
- else if(current_tick-last_tick>HZ) {
+ else if(TIME_AFTER(current_tick, switch_tick)) {
plug_state=!plug_state;
- last_tick=current_tick;
+ switch_tick=current_tick+HZ;
}
}
else