forked from len0rd/rockbox
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];
|
char s[32];
|
||||||
int buflen = ((mp3end - mp3buf) * 100) / 0x100000;
|
int buflen = ((mp3end - mp3buf) * 100) / 0x100000;
|
||||||
int integer, decimal;
|
int integer, decimal;
|
||||||
|
bool done = false;
|
||||||
lcd_clear_display();
|
|
||||||
lcd_puts(0, 0, "Rockbox info:");
|
|
||||||
/* TODO: add disk size/usage info, battery charge etc here? */
|
|
||||||
|
|
||||||
integer = buflen / 100;
|
while(!done)
|
||||||
decimal = buflen % 100;
|
{
|
||||||
|
lcd_clear_display();
|
||||||
|
lcd_puts(0, 0, "Rockbox info:");
|
||||||
|
|
||||||
|
integer = buflen / 100;
|
||||||
|
decimal = buflen % 100;
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
#ifdef HAVE_LCD_CHARCELLS
|
||||||
snprintf(s, sizeof(s), "Buf: %d.%02dMb", integer, decimal);
|
snprintf(s, sizeof(s), "Buf: %d.%02dMb", integer, decimal);
|
||||||
lcd_puts(0, 0, s);
|
lcd_puts(0, 0, s);
|
||||||
#else
|
#else
|
||||||
snprintf(s, sizeof(s), "Buffer: %d.%02d Mb", integer, decimal);
|
snprintf(s, sizeof(s), "Buffer: %d.%02d Mb", integer, decimal);
|
||||||
lcd_puts(0, 2, s);
|
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
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
lcd_update();
|
||||||
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();
|
|
||||||
|
|
||||||
/* Wait for a key to be pushed */
|
sleep(HZ/2);
|
||||||
while(button_get(true) & BUTTON_REL);
|
|
||||||
|
/* Wait for a key to be pushed */
|
||||||
|
if(button_get(false) & ~BUTTON_REL)
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void main_menu(void)
|
void main_menu(void)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue