From 709382c801254ba624c8e1ab5b63e637f2ed3b70 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 7 Aug 2002 13:05:13 +0000 Subject: Power plug is shown when charger is attached and blinking when charging is enabled git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1594 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/icons.c | 2 +- apps/status.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 482c764b52..89d7186224 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -73,7 +73,7 @@ unsigned char bitmap_icons_6x8[LastIcon][6] = static unsigned char bitmap_icon_7x8[][7] = { /* Power plug */ - {0x08,0x1c,0x1c,0x3e,0x3e,0x14,0x14}, + {0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Speaker */ {0x00,0x1c,0x1c,0x3e,0x7f,0x00,0x00}, /* Speaker mute */ 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; #ifdef HAVE_LCD_BITMAP bool statusbar_enabled = true; +long last_tick; +bool plug_state; #endif void status_init(void) { +#ifdef HAVE_LCD_BITMAP + last_tick = current_tick; +#endif status_set_playmode(STATUS_STOP); } @@ -130,7 +135,17 @@ void status_draw(void) if(global_settings.statusbar && statusbar_enabled) { statusbar_wipe(); #ifdef HAVE_CHARGE_CTRL - statusbar_icon_battery(battlevel,charger_enabled); + if(charger_inserted()) { + if(!charger_enabled) + plug_state=true; + else if(current_tick-last_tick>HZ) { + plug_state=!plug_state; + last_tick=current_tick; + } + } + else + plug_state=false; + statusbar_icon_battery(battlevel,plug_state); #else statusbar_icon_battery(battlevel,false); #endif -- cgit v1.2.3