Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach to host even if Serial, USBSerial1 and Keyboard/Mouse are disabled #1122

Merged
merged 3 commits into from
Nov 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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