Fix tinyusb_driver_install (dangling pointer)

(cherry picked from commit db90b512a1)
pull/9422/head
lsita 2022-06-29 17:40:19 +02:00 zatwierdzone przez songruojing
rodzic db8ef465a4
commit 41f78c1347
1 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -37,8 +37,6 @@ esp_err_t tinyusb_driver_install(const tinyusb_config_t *config)
.controller = USB_PHY_CTRL_OTG, .controller = USB_PHY_CTRL_OTG,
.otg_mode = USB_OTG_MODE_DEVICE, .otg_mode = USB_OTG_MODE_DEVICE,
}; };
if (config->external_phy) {
phy_conf.target = USB_PHY_TARGET_EXT;
usb_phy_gpio_conf_t gpio_conf = { usb_phy_gpio_conf_t gpio_conf = {
.vp_io_num = USBPHY_VP_NUM, .vp_io_num = USBPHY_VP_NUM,
.vm_io_num = USBPHY_VM_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, .vpo_io_num = USBPHY_VPO_NUM,
.vmo_io_num = USBPHY_VMO_NUM, .vmo_io_num = USBPHY_VMO_NUM,
}; };
if (config->external_phy) {
phy_conf.target = USB_PHY_TARGET_EXT;
phy_conf.gpio_conf = &gpio_conf; phy_conf.gpio_conf = &gpio_conf;
} else { } else {
phy_conf.target = USB_PHY_TARGET_INT; phy_conf.target = USB_PHY_TARGET_INT;