mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-15 20:42:23 +00:00
add s3 undefined speed note for racing issue with reset.
fix dcd_event_sof() with frame number
This commit is contained in:
parent
2109b801d4
commit
5b32df5abd
@ -175,20 +175,14 @@ bool usb_init(void) {
|
|||||||
// maybe we can use USB_OTG_MODE_DEFAULT and switch using dwc2 driver
|
// maybe we can use USB_OTG_MODE_DEFAULT and switch using dwc2 driver
|
||||||
#if CFG_TUD_ENABLED
|
#if CFG_TUD_ENABLED
|
||||||
.otg_mode = USB_OTG_MODE_DEVICE,
|
.otg_mode = USB_OTG_MODE_DEVICE,
|
||||||
.otg_speed = BOARD_TUD_RHPORT ? USB_PHY_SPEED_HIGH : USB_PHY_SPEED_FULL,
|
|
||||||
#elif CFG_TUH_ENABLED
|
#elif CFG_TUH_ENABLED
|
||||||
.otg_mode = USB_OTG_MODE_HOST,
|
.otg_mode = USB_OTG_MODE_HOST,
|
||||||
.otg_speed= BOARD_TUH_RHPORT ? USB_PHY_SPEED_HIGH : USB_PHY_SPEED_FULL,
|
|
||||||
#endif
|
#endif
|
||||||
|
// https://github.com/hathach/tinyusb/issues/2943#issuecomment-2601888322
|
||||||
|
// Set speed to undefined (auto-detect) to avoid timinng/racing issue with S3 with host such as macOS
|
||||||
|
.otg_speed = USB_PHY_SPEED_UNDEFINED,
|
||||||
};
|
};
|
||||||
|
|
||||||
// OTG IOs config
|
|
||||||
// const usb_phy_otg_io_conf_t otg_io_conf = USB_PHY_SELF_POWERED_DEVICE(config->vbus_monitor_io);
|
|
||||||
// if (config->self_powered) {
|
|
||||||
// phy_conf.otg_io_conf = &otg_io_conf;
|
|
||||||
// }
|
|
||||||
// ESP_RETURN_ON_ERROR(usb_new_phy(&phy_conf, &phy_hdl), TAG, "Install USB PHY failed");
|
|
||||||
|
|
||||||
usb_new_phy(&phy_conf, &phy_hdl);
|
usb_new_phy(&phy_conf, &phy_hdl);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -565,7 +565,7 @@ void dcd_int_handler(uint8_t rhport)
|
|||||||
|
|
||||||
if (is & USB_ISTAT_SOFTOK_MASK) {
|
if (is & USB_ISTAT_SOFTOK_MASK) {
|
||||||
KHCI->ISTAT = USB_ISTAT_SOFTOK_MASK;
|
KHCI->ISTAT = USB_ISTAT_SOFTOK_MASK;
|
||||||
dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
|
dcd_event_sof(rhport, tu_u16(KHCI->FRMNUMH, KHCI->FRMNUML), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is & USB_ISTAT_STALL_MASK) {
|
if (is & USB_ISTAT_STALL_MASK) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user