mirror of
https://github.com/hathach/tinyusb.git
synced 2026-03-17 13:05:15 +00:00
bsp/stm32f2: update vbus sense
Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
@ -31,7 +31,6 @@
|
||||
#include "stm32f2xx_hal.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Forward USB interrupt events to TinyUSB IRQ Handler
|
||||
//--------------------------------------------------------------------+
|
||||
@ -105,9 +104,14 @@ void board_init(void) {
|
||||
/* Enable USB FS Clocks */
|
||||
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
|
||||
|
||||
#if CFG_TUD_ENABLED
|
||||
// Enable VBUS sense (B device) via pin PA9
|
||||
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
|
||||
USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN;
|
||||
tud_configure_dwc2_t cfg = {
|
||||
.bm_double_buffered = 0,
|
||||
.vbus_sensing = true
|
||||
};
|
||||
tud_configure(0, TUD_CFGID_DWC2, &cfg);
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user