show_info() now updates the display continuously
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1494 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
17cf49a8c4
commit
217023ff67
1 changed files with 27 additions and 21 deletions
|
@ -137,33 +137,39 @@ void show_info(void)
|
|||
char s[32];
|
||||
int buflen = ((mp3end - mp3buf) * 100) / 0x100000;
|
||||
int integer, decimal;
|
||||
|
||||
lcd_clear_display();
|
||||
lcd_puts(0, 0, "Rockbox info:");
|
||||
/* TODO: add disk size/usage info, battery charge etc here? */
|
||||
bool done = false;
|
||||
|
||||
integer = buflen / 100;
|
||||
decimal = buflen % 100;
|
||||
while(!done)
|
||||
{
|
||||
lcd_clear_display();
|
||||
lcd_puts(0, 0, "Rockbox info:");
|
||||
|
||||
integer = buflen / 100;
|
||||
decimal = buflen % 100;
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
snprintf(s, sizeof(s), "Buf: %d.%02dMb", integer, decimal);
|
||||
lcd_puts(0, 0, s);
|
||||
snprintf(s, sizeof(s), "Buf: %d.%02dMb", integer, decimal);
|
||||
lcd_puts(0, 0, s);
|
||||
#else
|
||||
snprintf(s, sizeof(s), "Buffer: %d.%02d Mb", integer, decimal);
|
||||
lcd_puts(0, 2, s);
|
||||
snprintf(s, sizeof(s), "Buffer: %d.%02d Mb", integer, decimal);
|
||||
lcd_puts(0, 2, s);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
snprintf(s, sizeof(s), "Batt: %d%%", battery_level());
|
||||
lcd_puts(0, 1, s);
|
||||
#else
|
||||
snprintf(s, sizeof(s), "Battery: %d%%", battery_level());
|
||||
lcd_puts(0, 3, s);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
snprintf(s, sizeof(s), "Batt: %d%%", battery_level());
|
||||
lcd_puts(0, 1, s);
|
||||
#else
|
||||
snprintf(s, sizeof(s), "Battery: %d%%", battery_level());
|
||||
lcd_puts(0, 3, s);
|
||||
#endif
|
||||
|
||||
lcd_update();
|
||||
lcd_update();
|
||||
|
||||
/* Wait for a key to be pushed */
|
||||
while(button_get(true) & BUTTON_REL);
|
||||
sleep(HZ/2);
|
||||
|
||||
/* Wait for a key to be pushed */
|
||||
if(button_get(false) & ~BUTTON_REL)
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
void main_menu(void)
|
||||
|
|
Loading…
Reference in a new issue