diff options
-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 a41eab91b2..f88a552322 100644 --- a/apps/status.c +++ b/apps/status.c | |||
@@ -34,15 +34,12 @@ static enum playmode current_mode = STATUS_STOP; | |||
34 | 34 | ||
35 | #ifdef HAVE_LCD_BITMAP | 35 | #ifdef HAVE_LCD_BITMAP |
36 | bool statusbar_enabled = true; | 36 | bool statusbar_enabled = true; |
37 | long last_tick; | 37 | long switch_tick; |
38 | bool plug_state; | 38 | bool plug_state; |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | void status_init(void) | 41 | void status_init(void) |
42 | { | 42 | { |
43 | #ifdef HAVE_LCD_BITMAP | ||
44 | last_tick = current_tick; | ||
45 | #endif | ||
46 | status_set_playmode(STATUS_STOP); | 43 | status_set_playmode(STATUS_STOP); |
47 | } | 44 | } |
48 | 45 | ||
@@ -138,9 +135,9 @@ void status_draw(void) | |||
138 | if(charger_inserted()) { | 135 | if(charger_inserted()) { |
139 | if(!charger_enabled) | 136 | if(!charger_enabled) |
140 | plug_state=true; | 137 | plug_state=true; |
141 | else if(current_tick-last_tick>HZ) { | 138 | else if(TIME_AFTER(current_tick, switch_tick)) { |
142 | plug_state=!plug_state; | 139 | plug_state=!plug_state; |
143 | last_tick=current_tick; | 140 | switch_tick=current_tick+HZ; |
144 | } | 141 | } |
145 | } | 142 | } |
146 | else | 143 | else |