Skip to content

Commit

Permalink
Merge pull request #1122 from spark/feature/usb-always-attach
Browse files Browse the repository at this point in the history
Attach to host even if Serial, USBSerial1 and Keyboard/Mouse are disabled
  • Loading branch information
technobly authored Nov 22, 2016
2 parents a1483b2 + 1447485 commit 5fdb63a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hal/src/stm32f2xx/usb_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ void HAL_USB_Detach(void)
void HAL_USB_Attach(void)
{
if (USB_Configured) {
// Do not attach if there are no USB classes registered
if (USBD_Composite_Registered_Count(true) > 0)
USB_Cable_Config(ENABLE);
// Attach even if there are no classes registered
// We still want the control interface that receives vendor requests
// to be available.
USB_Cable_Config(ENABLE);
}
}

Expand Down

0 comments on commit 5fdb63a

Please sign in to comment.