diff options
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/sansa_as3525.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bootloader/sansa_as3525.c b/bootloader/sansa_as3525.c index 9248921eed..e63bb2c749 100644 --- a/bootloader/sansa_as3525.c +++ b/bootloader/sansa_as3525.c | |||
@@ -27,6 +27,11 @@ | |||
27 | #include <inttypes.h> | 27 | #include <inttypes.h> |
28 | #include "config.h" | 28 | #include "config.h" |
29 | #include "lcd.h" | 29 | #include "lcd.h" |
30 | #ifdef USE_ROCKBOX_USB | ||
31 | #include "usb.h" | ||
32 | #include "usb_core.h" | ||
33 | #include "sysfont.h" | ||
34 | #endif /* USE_ROCKBOX_USB */ | ||
30 | #include "backlight.h" | 35 | #include "backlight.h" |
31 | #include "button-target.h" | 36 | #include "button-target.h" |
32 | #include "common.h" | 37 | #include "common.h" |
@@ -82,6 +87,29 @@ void main(void) | |||
82 | if(ret < 0) | 87 | if(ret < 0) |
83 | error(EATA,ret); | 88 | error(EATA,ret); |
84 | 89 | ||
90 | #ifdef USE_ROCKBOX_USB | ||
91 | usb_init(); | ||
92 | if(usb_detect() == USB_INSERTED) | ||
93 | { | ||
94 | const char msg[] = "Bootloader USB mode"; | ||
95 | reset_screen(); | ||
96 | lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * sizeof(msg))) / 2, | ||
97 | (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg); | ||
98 | lcd_update(); | ||
99 | |||
100 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true); | ||
101 | usb_enable(true); | ||
102 | |||
103 | while(usb_detect() == USB_INSERTED) | ||
104 | sleep(HZ); | ||
105 | |||
106 | usb_enable(false); | ||
107 | |||
108 | reset_screen(); | ||
109 | lcd_update(); | ||
110 | } | ||
111 | #endif /* USE_ROCKBOX_USB */ | ||
112 | |||
85 | if(!disk_init(IF_MV(0))) | 113 | if(!disk_init(IF_MV(0))) |
86 | panicf("disk_init failed!"); | 114 | panicf("disk_init failed!"); |
87 | 115 | ||