Skip to content

Commit

Permalink
Disable VBUS USB sensing
Browse files Browse the repository at this point in the history
  it messes up PA9 aka JACDAC TX
  • Loading branch information
mmoskal committed Mar 26, 2019
1 parent 6218364 commit 06a24a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ usb_cinit(void)
usbd_dev = usbd_init(&otgfs_usb_driver, &dev, &config, &bos, usb_strings, NUM_USB_STRINGS,
usbd_control_buffer, sizeof(usbd_control_buffer));

#if defined(BOARD_USB_VBUS_SENSE_DISABLED)
// disable VBUS sensing
OTG_FS_GCCFG &= ~(OTG_GCCFG_VBUSASEN | OTG_GCCFG_VBUSBSEN);
#endif

#elif defined(STM32F1)
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
gpio_set(GPIOA, GPIO8);
Expand Down

0 comments on commit 06a24a1

Please sign in to comment.