From b1cb5348569497145b7daf3b40e69896cea97ddc Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 7 Aug 2002 13:36:52 +0000 Subject: Using TIME_AFTER() macro to prevent wrap problem git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1595 a1c6a512-1295-4272-9138-f99709370657 --- apps/status.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'apps/status.c') diff --git a/apps/status.c b/apps/status.c index a41eab91b2..f88a552322 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 -- cgit v1.2.3