diff options
Diffstat (limited to 'bootloader/sansaconnect.c')
-rw-r--r-- | bootloader/sansaconnect.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bootloader/sansaconnect.c b/bootloader/sansaconnect.c index a87b23745f..c5dbca717d 100644 --- a/bootloader/sansaconnect.c +++ b/bootloader/sansaconnect.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id: $ | 8 | * $Id: $ |
9 | * | 9 | * |
10 | * Copyright (C) 2011 by Tomasz Moń | 10 | * Copyright (C) 2011-2021 by Tomasz Moń |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -32,6 +32,7 @@ | |||
32 | #include "uart-target.h" | 32 | #include "uart-target.h" |
33 | #include "power.h" | 33 | #include "power.h" |
34 | #include "loader_strerror.h" | 34 | #include "loader_strerror.h" |
35 | #include "usb.h" | ||
35 | 36 | ||
36 | #define FLASH_BASE 0x00100000 | 37 | #define FLASH_BASE 0x00100000 |
37 | #define PARAMETERS_FLASH_OFFSET 0x00010000 | 38 | #define PARAMETERS_FLASH_OFFSET 0x00010000 |
@@ -206,6 +207,8 @@ void main(void) | |||
206 | 207 | ||
207 | printf("Rockbox boot loader"); | 208 | printf("Rockbox boot loader"); |
208 | printf("Version %s", rbversion); | 209 | printf("Version %s", rbversion); |
210 | usb_init(); | ||
211 | usb_start_monitoring(); | ||
209 | 212 | ||
210 | clear_recoverzap(); | 213 | clear_recoverzap(); |
211 | 214 | ||
@@ -215,6 +218,17 @@ void main(void) | |||
215 | 218 | ||
216 | filesystem_init(); | 219 | filesystem_init(); |
217 | 220 | ||
221 | if (usb_detect() == USB_INSERTED) | ||
222 | { | ||
223 | usb_enable(true); | ||
224 | while (usb_detect() == USB_INSERTED) | ||
225 | { | ||
226 | sleep(HZ); | ||
227 | storage_spin(); | ||
228 | } | ||
229 | usb_enable(false); | ||
230 | } | ||
231 | |||
218 | ret = disk_mount_all(); | 232 | ret = disk_mount_all(); |
219 | if (ret <= 0) | 233 | if (ret <= 0) |
220 | error(EDISK, ret, true); | 234 | error(EDISK, ret, true); |
@@ -269,8 +283,8 @@ void main(void) | |||
269 | ret = kernel_entry(); | 283 | ret = kernel_entry(); |
270 | printf("FAILED!"); | 284 | printf("FAILED!"); |
271 | } | 285 | } |
272 | 286 | ||
273 | storage_sleepnow(); | 287 | storage_sleepnow(); |
274 | 288 | ||
275 | while(1); | 289 | while(1); |
276 | } | 290 | } |