| 234 | } |
| 235 | |
| 236 | void tusbStop() { |
| 237 | // Actively signal a disconnect to the host before tearing down the peripheral, otherwise |
| 238 | // a subsequent esp_restart() resets the chip too fast for the host to notice the device |
| 239 | // went away, leaving it stuck showing the old MSC device until the cable is replugged. |
| 240 | tud_disconnect(); |
| 241 | vTaskDelay(pdMS_TO_TICKS(250)); |
| 242 | |
| 243 | tinyusb_msc_storage_deinit(); |
| 244 | #if CONFIG_IDF_TARGET_ESP32P4 |
| 245 | usb_wrap_ll_phy_select(&USB_WRAP, 1); |
| 246 | #endif |
| 247 | } |
| 248 | |
| 249 | bool tusbCanStartMassStorageWithFlash() { |
| 250 | return tusbIsSupported() && (tt::getDataPartitionWlHandle() != WL_INVALID_HANDLE); |