application: disable VBUS sensing

This commit is contained in:
King Kévin 2021-09-24 16:00:55 +02:00
parent a2f203a81f
commit ea30c7c879
1 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include <libopencm3/stm32/dbgmcu.h> // debug utilities
#include <libopencm3/stm32/desig.h> // design utilities
#include <libopencm3/stm32/flash.h> // flash utilities
#include <libopencm3/usb/dwc/otg_fs.h> // USB definitions
/* own libraries */
#include "global.h" // board definitions
@ -379,6 +380,8 @@ void main(void)
board_setup(); // setup board
uart_setup(); // setup USART (for printing)
usb_cdcacm_setup(); // setup USB CDC ACM (for printing)
OTG_FS_GCCFG |= OTG_GCCFG_NOVBUSSENS | OTG_GCCFG_PWRDWN; // disable VBUS sensing
OTG_FS_GCCFG &= ~(OTG_GCCFG_VBUSBSEN | OTG_GCCFG_VBUSASEN); // force USB device mode
puts("\nwelcome to the CuVoodoo STM32F4 example firmware\n"); // print welcome message
#if DEBUG