diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-07-29 10:47:24 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-29 10:47:24 -0700 |
| commit | b76d37f24a3f1d8e26e080ed9b88e05af6dfae5c (patch) | |
| tree | ff13b3c6131c969c54d5d22e5160f9898a356373 /supervisor | |
| parent | 05a1519e5d1f508ab02c27da5f30eeb87ed56819 (diff) | |
| parent | 65c22aa4347abc145493f44a4bc8d91a4f200860 (diff) | |
Merge pull request #3223 from dhalbert/unmount-before-reset
storage.erase_filesystem(): disconnect from USB and wait 1 second before resetting
Diffstat (limited to 'supervisor')
| -rw-r--r-- | supervisor/shared/usb/usb.c | 4 | ||||
| -rw-r--r-- | supervisor/usb.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 36b5ec05d..e8541669a 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -74,6 +74,10 @@ void usb_init(void) { #endif } +void usb_disconnect(void) { + tud_disconnect(); +} + void usb_background(void) { if (usb_enabled()) { #if CFG_TUSB_OS == OPT_OS_NONE diff --git a/supervisor/usb.h b/supervisor/usb.h index 2a447c368..0dead3e26 100644 --- a/supervisor/usb.h +++ b/supervisor/usb.h @@ -45,6 +45,7 @@ void init_usb_hardware(void); // Shared implementation. bool usb_enabled(void); void usb_init(void); +void usb_disconnect(void); // Propagate plug/unplug events to the MSC logic. void usb_msc_mount(void); |
