diff options
| author | Markus Braun <markus.braun@krawel.de> | 2002-08-07 13:36:52 +0000 |
|---|---|---|
| committer | Markus Braun <markus.braun@krawel.de> | 2002-08-07 13:36:52 +0000 |
| commit | b1cb5348569497145b7daf3b40e69896cea97ddc (patch) | |
| tree | 0d7cae30864aaba8fb693645aacb68caf270b984 /apps/status.c | |
| parent | 709382c801254ba624c8e1ab5b63e637f2ed3b70 (diff) | |
| download | rockbox-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/status.c')
| -rw-r--r-- | apps/status.c | 9 |
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 |