MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / tusbStop

Function tusbStop

Tactility/Source/hal/usb/UsbTusb.cpp:236–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void 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
249bool tusbCanStartMassStorageWithFlash() {
250 return tusbIsSupported() && (tt::getDataPartitionWlHandle() != WL_INVALID_HANDLE);

Callers 1

stopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected