tinyusb: Fix stm32f4 VBUS detection
VBUS detection A9 pin should be set as input not AF10.
Bit USB_OTG_GCCFG_VBUSASEN was not set instead all others
were which does not make sense.
@@ -69,8 +69,8 @@ tinyusb_hardware_init(void)
#else
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN;
- USB_OTG_FS->GCCFG |= ~USB_OTG_GCCFG_VBUSASEN;
- hal_gpio_init_af(MCU_GPIO_PORTA(9), GPIO_AF10_OTG_FS, GPIO_NOPULL, GPIO_MODE_AF_PP);
+ USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSASEN;
+ hal_gpio_init_in(MCU_GPIO_PORTA(9), HAL_GPIO_PULL_NONE);
#endif
#elif USB_OTG_GCCFG_VBDEN
#if MYNEWT_VAL(USB_VBUS_DETECTION_ENABLE)
