summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-10-15 07:21:34 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-10-15 07:21:34 +0000
commit57688469f484a280cb26f9b8d0be22c7cb24fa4a (patch)
treec4972b26662796e668e9f9c58a9ba140bb261612
parent2974dcb07ef8b6493a4144bc29478b7f5ebeb1ec (diff)
fixed the buffer info to use one more decimal, also now require both a key
press and key release even to exit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2630 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/main_menu.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c
index aa87ed39a3..de51b57701 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -151,17 +151,19 @@ extern unsigned char mp3end[];
bool show_info(void)
{
char s[32];
- int buflen = ((mp3end - mp3buf) * 100) / 0x100000;
+ int buflen = ((mp3end - mp3buf) * 1000) / 0x100000;
int integer, decimal;
bool done = false;
+ int key;
+ int state=0;
while(!done)
{
lcd_clear_display();
lcd_puts(0, 0, str(LANG_ROCKBOX_INFO));
- integer = buflen / 100;
- decimal = buflen % 100;
+ integer = buflen / 1000;
+ decimal = buflen % 1000;
#ifdef HAVE_LCD_CHARCELLS
snprintf(s, sizeof(s), str(LANG_BUFFER_STAT_PLAYER), integer, decimal);
lcd_puts(0, 0, s);
@@ -192,11 +194,22 @@ bool show_info(void)
lcd_update();
- sleep(HZ/2);
-
/* Wait for a key to be pushed */
- if(button_get(false) & ~BUTTON_REL)
- done = true;
+ key = button_get_w_tmo(HZ/2);
+ if(key) {
+ switch(state) {
+ case 0:
+ /* first, a non-release event */
+ if(!(key&BUTTON_REL))
+ state++;
+ break;
+ case 1:
+ /* then a release-event */
+ if(key&BUTTON_REL)
+ done = true;
+ break;
+ }
+ }
}
return false;
@@ -242,3 +255,10 @@ bool main_menu(void)
return result;
}
+
+/* -----------------------------------------------------------------
+ * local variables:
+ * eval: (load-file "../firmware/rockbox-mode.el")
+ * end:
+ * vim: et sw=4 ts=8 sts=4 tw=78
+ */