summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-06-18 01:47:39 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-06-18 01:47:39 +0000
commitb812465bfff2111e149a44d7041c1d62d7e1519c (patch)
tree18c654b306088c1e9a19aab2f5dc444845c922c7 /bootloader
parent6470a9ffd132f0315e1c62cbf01e2a1963b874ab (diff)
downloadrockbox-b812465bfff2111e149a44d7041c1d62d7e1519c.tar.gz
rockbox-b812465bfff2111e149a44d7041c1d62d7e1519c.tar.bz2
rockbox-b812465bfff2111e149a44d7041c1d62d7e1519c.zip
as3525: bootloader USB mode
not working yet : an empty drive is detected won't link on fuzev1: drivers allocated in usb_storage.c are too large git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26905 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/sansa_as3525.c28
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 @@
#include <inttypes.h>
#include "config.h"
#include "lcd.h"
+#ifdef USE_ROCKBOX_USB
+#include "usb.h"
+#include "usb_core.h"
+#include "sysfont.h"
+#endif /* USE_ROCKBOX_USB */
#include "backlight.h"
#include "button-target.h"
#include "common.h"
@@ -82,6 +87,29 @@ void main(void)
if(ret < 0)
error(EATA,ret);
+#ifdef USE_ROCKBOX_USB
+ usb_init();
+ if(usb_detect() == USB_INSERTED)
+ {
+ const char msg[] = "Bootloader USB mode";
+ reset_screen();
+ lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * sizeof(msg))) / 2,
+ (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg);
+ lcd_update();
+
+ usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true);
+ usb_enable(true);
+
+ while(usb_detect() == USB_INSERTED)
+ sleep(HZ);
+
+ usb_enable(false);
+
+ reset_screen();
+ lcd_update();
+ }
+#endif /* USE_ROCKBOX_USB */
+
if(!disk_init(IF_MV(0)))
panicf("disk_init failed!");