mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Fix tinyusb_driver_install (dangling pointer)
(cherry picked from commit db90b512a1
)
This commit is contained in:
@ -37,8 +37,6 @@ esp_err_t tinyusb_driver_install(const tinyusb_config_t *config)
|
||||
.controller = USB_PHY_CTRL_OTG,
|
||||
.otg_mode = USB_OTG_MODE_DEVICE,
|
||||
};
|
||||
if (config->external_phy) {
|
||||
phy_conf.target = USB_PHY_TARGET_EXT;
|
||||
usb_phy_gpio_conf_t gpio_conf = {
|
||||
.vp_io_num = USBPHY_VP_NUM,
|
||||
.vm_io_num = USBPHY_VM_NUM,
|
||||
@ -47,6 +45,8 @@ esp_err_t tinyusb_driver_install(const tinyusb_config_t *config)
|
||||
.vpo_io_num = USBPHY_VPO_NUM,
|
||||
.vmo_io_num = USBPHY_VMO_NUM,
|
||||
};
|
||||
if (config->external_phy) {
|
||||
phy_conf.target = USB_PHY_TARGET_EXT;
|
||||
phy_conf.gpio_conf = &gpio_conf;
|
||||
} else {
|
||||
phy_conf.target = USB_PHY_TARGET_INT;
|
||||
|
Reference in New Issue
Block a user