summaryrefslogtreecommitdiff
path: root/apps/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/status.c')
-rw-r--r--apps/status.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/status.c b/apps/status.c
index a106641a40..a41eab91b2 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -34,10 +34,15 @@ static enum playmode current_mode = STATUS_STOP;
34 34
35#ifdef HAVE_LCD_BITMAP 35#ifdef HAVE_LCD_BITMAP
36bool statusbar_enabled = true; 36bool statusbar_enabled = true;
37long last_tick;
38bool plug_state;
37#endif 39#endif
38 40
39void status_init(void) 41void status_init(void)
40{ 42{
43#ifdef HAVE_LCD_BITMAP
44 last_tick = current_tick;
45#endif
41 status_set_playmode(STATUS_STOP); 46 status_set_playmode(STATUS_STOP);
42} 47}
43 48
@@ -130,7 +135,17 @@ void status_draw(void)
130 if(global_settings.statusbar && statusbar_enabled) { 135 if(global_settings.statusbar && statusbar_enabled) {
131 statusbar_wipe(); 136 statusbar_wipe();
132#ifdef HAVE_CHARGE_CTRL 137#ifdef HAVE_CHARGE_CTRL
133 statusbar_icon_battery(battlevel,charger_enabled); 138 if(charger_inserted()) {
139 if(!charger_enabled)
140 plug_state=true;
141 else if(current_tick-last_tick>HZ) {
142 plug_state=!plug_state;
143 last_tick=current_tick;
144 }
145 }
146 else
147 plug_state=false;
148 statusbar_icon_battery(battlevel,plug_state);
134#else 149#else
135 statusbar_icon_battery(battlevel,false); 150 statusbar_icon_battery(battlevel,false);
136#endif 151#endif