forked from len0rd/rockbox
now uses battery_level_safe() to determine when to blink
inserted "free" spaces git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1684 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cccb8d0a64
commit
1cf6fa07d5
1 changed files with 15 additions and 13 deletions
|
@ -134,37 +134,39 @@ void status_draw(void)
|
||||||
statusbar_wipe();
|
statusbar_wipe();
|
||||||
#ifdef HAVE_CHARGE_CTRL
|
#ifdef HAVE_CHARGE_CTRL
|
||||||
if(charger_inserted()) {
|
if(charger_inserted()) {
|
||||||
battery_state=true;
|
battery_state = true;
|
||||||
if(!charger_enabled)
|
if(!charger_enabled)
|
||||||
plug_state=true;
|
plug_state = true;
|
||||||
else if(TIME_AFTER(current_tick, switch_tick)) {
|
else if(TIME_AFTER(current_tick, switch_tick)) {
|
||||||
plug_state=!plug_state;
|
plug_state = !plug_state;
|
||||||
switch_tick=current_tick+HZ;
|
switch_tick = current_tick + HZ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plug_state=false;
|
plug_state=false;
|
||||||
if(battlevel > (BATTERY_LEVEL_DANGEROUS-BATTERY_LEVEL_EMPTY)*100/BATTERY_RANGE)
|
if(battlevel > battery_level_safe())
|
||||||
battery_state=true;
|
battery_state = true;
|
||||||
else
|
else
|
||||||
if(TIME_AFTER(current_tick, switch_tick)) {
|
if(TIME_AFTER(current_tick, switch_tick)) {
|
||||||
switch_tick=current_tick+HZ;
|
switch_tick = current_tick+HZ;
|
||||||
battery_state=!battery_state;
|
battery_state =! battery_state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(battery_state) statusbar_icon_battery(battlevel,plug_state);
|
if(battery_state) statusbar_icon_battery(battlevel, plug_state);
|
||||||
#else
|
#else
|
||||||
statusbar_icon_battery(battlevel,false);
|
statusbar_icon_battery(battlevel, false);
|
||||||
#endif
|
#endif
|
||||||
statusbar_icon_volume(volume);
|
statusbar_icon_volume(volume);
|
||||||
statusbar_icon_play_state(current_mode+Icon_Play);
|
statusbar_icon_play_state(current_mode + Icon_Play);
|
||||||
if (global_settings.loop_playlist)
|
if (global_settings.loop_playlist)
|
||||||
statusbar_icon_play_mode(Icon_Repeat);
|
statusbar_icon_play_mode(Icon_Repeat);
|
||||||
else
|
else
|
||||||
statusbar_icon_play_mode(Icon_Normal);
|
statusbar_icon_play_mode(Icon_Normal);
|
||||||
if(global_settings.playlist_shuffle) statusbar_icon_shuffle();
|
if(global_settings.playlist_shuffle)
|
||||||
if (keys_locked) statusbar_icon_lock();
|
statusbar_icon_shuffle();
|
||||||
|
if (keys_locked)
|
||||||
|
statusbar_icon_lock();
|
||||||
#ifdef HAVE_RTC
|
#ifdef HAVE_RTC
|
||||||
statusbar_time();
|
statusbar_time();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue