summaryrefslogtreecommitdiffstats
path: root/apps/bookmark.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-07-26 16:06:59 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-07-26 16:06:59 +0000
commitade5d7b848bf9c0d46bb14c85528453f969c9429 (patch)
tree197aa919b9a3c2a89f77d12b01cc1c2c23f7e37f /apps/bookmark.c
parent3d91885718a1fb9d6d55f07f67a9a1942a352c5e (diff)
downloadrockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.tar.gz
rockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.tar.bz2
rockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.zip
First step in revamping the USB event handling, paving the way for the upcoming SYS_POWER_OFF event
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4951 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 993ea7e0ca..8d60de28fe 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -45,6 +45,7 @@
#include "kernel.h"
#include "sprintf.h"
#include "talk.h"
+#include "misc.h"
#define MAX_BOOKMARKS 10
#define MAX_BOOKMARK_SIZE 350
@@ -277,12 +278,10 @@ bool bookmark_autobookmark(void)
done = true;
break;
- case SYS_USB_CONNECTED:
- usb_screen();
-#ifdef HAVE_LCD_CHARCELLS
- status_set_param(true);
-#endif
- return false;
+ default:
+ if(default_event_handler(key) == SYS_USB_CONNECTED)
+ return false;
+ break;
}
}
return true;
@@ -511,25 +510,23 @@ bool bookmark_autoload(char* file)
while(!done)
{
+ button_clear_queue();
+
/* Wait for a key to be pushed */
- while (button_get(false)); /* clear button queue */
key = button_get(true);
switch(key)
{
- default:
- return false;
#ifdef HAVE_LCD_BITMAP
case BUTTON_DOWN:
return bookmark_load(global_bookmark_file_name, false);
#endif
case BUTTON_PLAY:
return bookmark_load(global_bookmark_file_name, true);
- case SYS_USB_CONNECTED:
- usb_screen();
-#ifdef HAVE_LCD_CHARCELLS
- status_set_param(true);
-#endif
- return true;
+
+ default:
+ if(default_event_handler(key) == SYS_USB_CONNECTED)
+ return true;
+ return false;
}
}
return true;
@@ -690,12 +687,6 @@ static char* select_bookmark(char* bookmark_file_name)
while (button_get(false)); /* clear button queue */
break;
- case SYS_USB_CONNECTED:
- usb_screen();
-#ifdef HAVE_LCD_CHARCELLS
- status_set_param(true);
-#endif
- return NULL;
#ifdef HAVE_RECORDER_KEYPAD
case BUTTON_UP:
bookmark_id--;
@@ -726,6 +717,10 @@ static char* select_bookmark(char* bookmark_file_name)
case BUTTON_STOP:
return NULL;
#endif
+ default:
+ if(default_event_handler(key) == SYS_USB_CONNECTED)
+ return NULL;
+ break;
}
}