summaryrefslogtreecommitdiff
path: root/apps/wps.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-07-01 11:06:23 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-07-01 11:06:23 +0000
commitc4c52f82091e1dd117d232df4efecece185fc958 (patch)
tree96119a44c00a3fbd7193d8962c276f9e55832632 /apps/wps.c
parent53b8c995218647321e0e6d6a421af1ae9fa24710 (diff)
downloadrockbox-c4c52f82091e1dd117d232df4efecece185fc958.zip
rockbox-c4c52f82091e1dd117d232df4efecece185fc958.tar.gz
rockbox-c4c52f82091e1dd117d232df4efecece185fc958.tar.bz2
rockbox-c4c52f82091e1dd117d232df4efecece185fc958.tar.xz
WPS screen now handles USB detection
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1282 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/wps.c')
-rw-r--r--apps/wps.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/wps.c b/apps/wps.c
index 25ce735..cad1053 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -30,6 +30,7 @@
#include "settings.h"
#include "wps.h"
#include "mpeg.h"
+#include "usb.h"
#define LINE_Y 1 /* initial line */
@@ -112,7 +113,7 @@ static void draw_screen(struct mp3entry* id3)
}
/* demonstrates showing different formats from playtune */
-void wps_show(void)
+int wps_show(void)
{
static bool playing = true;
struct mp3entry* id3 = mpeg_current_track();
@@ -159,7 +160,7 @@ void wps_show(void)
for ( i=0;i<5;i++ ) {
switch ( button_get(false) ) {
case BUTTON_ON:
- return;
+ return 0;
#ifdef HAVE_RECORDER_KEYPAD
case BUTTON_PLAY:
@@ -205,6 +206,22 @@ void wps_show(void)
#endif
mpeg_stop();
break;
+
+#ifndef SIMULATOR
+ case SYS_USB_CONNECTED:
+ /* Tell the USB thread that we are safe */
+ DEBUGF("dirbrowse got SYS_USB_CONNECTED\n");
+ usb_acknowledge(SYS_USB_CONNECTED_ACK);
+
+ usb_display_info();
+
+ /* Wait until the USB cable is extracted again */
+ usb_wait_for_disconnect(&button_queue);
+
+ /* Signal to our caller that we have been in USB mode */
+ return SYS_USB_CONNECTED;
+ break;
+#endif
}
sleep(HZ/10);
}