summaryrefslogtreecommitdiff
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-06-30 14:11:28 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-06-30 14:11:28 +0000
commit8151236d337ca1368dfe0354f0968d3e9f4602fe (patch)
tree66e4d4085f204378c9d10c247383c90f2c533d33 /firmware/usb.c
parent6c77cc3576ab3ebd401c52e7e53b84042e052dbe (diff)
downloadrockbox-8151236d337ca1368dfe0354f0968d3e9f4602fe.zip
rockbox-8151236d337ca1368dfe0354f0968d3e9f4602fe.tar.gz
rockbox-8151236d337ca1368dfe0354f0968d3e9f4602fe.tar.bz2
rockbox-8151236d337ca1368dfe0354f0968d3e9f4602fe.tar.xz
Added usb_display_info()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1266 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index c6ae306..3e6f058 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -26,6 +26,7 @@
#include "fat.h"
#include "disk.h"
#include "panic.h"
+#include "lcd.h"
#define USB_REALLY_BRAVE
@@ -109,7 +110,7 @@ static void usb_thread(void)
DEBUGF("USB inserted. Waiting for ack from %d threads...\n",
num_acks_to_expect);
break;
-
+
case SYS_USB_CONNECTED_ACK:
if(waiting_for_ack)
{
@@ -121,7 +122,7 @@ static void usb_thread(void)
maybe even play some games and stuff. However, the
current firmware isn't quite ready for this yet.
Let's just chicken out and reboot. */
- DEBUGF("All threads have acknowledged. Rebooting...\n");
+ DEBUGF("All threads have acknowledged. Continuing...\n");
#ifdef USB_REALLY_BRAVE
usb_slave_mode(true);
#else
@@ -136,6 +137,9 @@ static void usb_thread(void)
break;
case USB_EXTRACTED:
+ /* First disable the USB mode */
+ usb_slave_mode(false);
+
/* Tell all threads that we are back in business */
num_acks_to_expect =
queue_broadcast(SYS_USB_DISCONNECTED, NULL) - 1;
@@ -151,7 +155,6 @@ static void usb_thread(void)
if(num_acks_to_expect == 0)
{
DEBUGF("All threads have acknowledged. We're in business.\n");
- usb_slave_mode(false);
}
else
{
@@ -228,6 +231,19 @@ void usb_start_monitoring(void)
usb_monitor_enabled = true;
}
+void usb_display_info(void)
+{
+ lcd_stop_scroll();
+ lcd_clear_display();
+
+#ifdef HAVE_LCD_BITMAP
+ lcd_puts(4, 3, "[USB Mode]");
+ lcd_update();
+#else
+ lcd_puts(0, 0, "[USB Mode]");
+#endif
+}
+
#else
/* Dummy simulator functions */
@@ -244,4 +260,8 @@ void usb_start_monitoring(void)
{
}
+void usb_display_info(void)
+{
+}
+
#endif