summaryrefslogtreecommitdiff
path: root/firmware
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
parent6c77cc3576ab3ebd401c52e7e53b84042e052dbe (diff)
downloadrockbox-8151236d337ca1368dfe0354f0968d3e9f4602fe.tar.gz
rockbox-8151236d337ca1368dfe0354f0968d3e9f4602fe.zip
Added usb_display_info()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1266 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/usb.c26
-rw-r--r--firmware/usb.h1
2 files changed, 24 insertions, 3 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index c6ae306218..3e6f058bf1 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -26,6 +26,7 @@
26#include "fat.h" 26#include "fat.h"
27#include "disk.h" 27#include "disk.h"
28#include "panic.h" 28#include "panic.h"
29#include "lcd.h"
29 30
30 31
31#define USB_REALLY_BRAVE 32#define USB_REALLY_BRAVE
@@ -109,7 +110,7 @@ static void usb_thread(void)
109 DEBUGF("USB inserted. Waiting for ack from %d threads...\n", 110 DEBUGF("USB inserted. Waiting for ack from %d threads...\n",
110 num_acks_to_expect); 111 num_acks_to_expect);
111 break; 112 break;
112 113
113 case SYS_USB_CONNECTED_ACK: 114 case SYS_USB_CONNECTED_ACK:
114 if(waiting_for_ack) 115 if(waiting_for_ack)
115 { 116 {
@@ -121,7 +122,7 @@ static void usb_thread(void)
121 maybe even play some games and stuff. However, the 122 maybe even play some games and stuff. However, the
122 current firmware isn't quite ready for this yet. 123 current firmware isn't quite ready for this yet.
123 Let's just chicken out and reboot. */ 124 Let's just chicken out and reboot. */
124 DEBUGF("All threads have acknowledged. Rebooting...\n"); 125 DEBUGF("All threads have acknowledged. Continuing...\n");
125#ifdef USB_REALLY_BRAVE 126#ifdef USB_REALLY_BRAVE
126 usb_slave_mode(true); 127 usb_slave_mode(true);
127#else 128#else
@@ -136,6 +137,9 @@ static void usb_thread(void)
136 break; 137 break;
137 138
138 case USB_EXTRACTED: 139 case USB_EXTRACTED:
140 /* First disable the USB mode */
141 usb_slave_mode(false);
142
139 /* Tell all threads that we are back in business */ 143 /* Tell all threads that we are back in business */
140 num_acks_to_expect = 144 num_acks_to_expect =
141 queue_broadcast(SYS_USB_DISCONNECTED, NULL) - 1; 145 queue_broadcast(SYS_USB_DISCONNECTED, NULL) - 1;
@@ -151,7 +155,6 @@ static void usb_thread(void)
151 if(num_acks_to_expect == 0) 155 if(num_acks_to_expect == 0)
152 { 156 {
153 DEBUGF("All threads have acknowledged. We're in business.\n"); 157 DEBUGF("All threads have acknowledged. We're in business.\n");
154 usb_slave_mode(false);
155 } 158 }
156 else 159 else
157 { 160 {
@@ -228,6 +231,19 @@ void usb_start_monitoring(void)
228 usb_monitor_enabled = true; 231 usb_monitor_enabled = true;
229} 232}
230 233
234void usb_display_info(void)
235{
236 lcd_stop_scroll();
237 lcd_clear_display();
238
239#ifdef HAVE_LCD_BITMAP
240 lcd_puts(4, 3, "[USB Mode]");
241 lcd_update();
242#else
243 lcd_puts(0, 0, "[USB Mode]");
244#endif
245}
246
231#else 247#else
232 248
233/* Dummy simulator functions */ 249/* Dummy simulator functions */
@@ -244,4 +260,8 @@ void usb_start_monitoring(void)
244{ 260{
245} 261}
246 262
263void usb_display_info(void)
264{
265}
266
247#endif 267#endif
diff --git a/firmware/usb.h b/firmware/usb.h
index 8775e672a4..bbdf53f9d9 100644
--- a/firmware/usb.h
+++ b/firmware/usb.h
@@ -23,5 +23,6 @@ void usb_init(void);
23void usb_start_monitoring(void); 23void usb_start_monitoring(void);
24void usb_acknowledge(int id); 24void usb_acknowledge(int id);
25void usb_wait_for_disconnect(struct event_queue *q); 25void usb_wait_for_disconnect(struct event_queue *q);
26void usb_display_info(void);
26 27
27#endif 28#endif