diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-21 23:32:01 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-21 23:32:01 +0000 |
commit | 8913c04831c94d2bcb82b0447ab7ccf6b2e346a6 (patch) | |
tree | cd87113bd36176bf7af18102064af6be4cfefdd0 /stmhal/main.c | |
parent | c070ff24a950cb764c8d51fa69f5a002e49fb3e4 (diff) | |
download | micropython-8913c04831c94d2bcb82b0447ab7ccf6b2e346a6.tar.gz micropython-8913c04831c94d2bcb82b0447ab7ccf6b2e346a6.zip |
stmhal: Add support for USB MSC device.
This gives a functioning, independent MSC device.
Diffstat (limited to 'stmhal/main.c')
-rw-r--r-- | stmhal/main.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/stmhal/main.c b/stmhal/main.c index 522ebfa6b1..d92ccdd5b1 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -374,6 +374,10 @@ soft_reset: // turn boot-up LED off led_state(PYB_LED_GREEN, 0); +#if defined(USE_DEVICE_MODE) + usbd_storage_medium_kind_t usbd_medium_kind = USBD_STORAGE_MEDIUM_FLASH; +#endif + #if MICROPY_HW_HAS_SDCARD // if an SD card is present then mount it on 1:/ if (sdcard_is_present()) { @@ -383,8 +387,8 @@ soft_reset: } else { if (first_soft_reset) { // use SD card as medium for the USB MSD -#if 0 - usbd_storage_select_medium(USBD_STORAGE_MEDIUM_SDCARD); +#if defined(USE_DEVICE_MODE) + usbd_medium_kind = USBD_STORAGE_MEDIUM_SDCARD; #endif } } @@ -396,7 +400,7 @@ soft_reset: pyb_usb_host_init(); #elif defined(USE_DEVICE_MODE) // USB device - pyb_usb_dev_init(PYB_USB_DEV_VCP_MSC); + pyb_usb_dev_init(USBD_DEVICE_MSC, usbd_medium_kind); #endif #if MICROPY_HW_HAS_MMA7660 |