Fixed logic hole breaking USB operations on a USB controller with only one supported USB mode and no USB_DEVICE_ONLY or USB_HOST_ONLY configuration token set.
This commit is contained in:
parent
e225de8a83
commit
44aea22949
10 changed files with 49 additions and 38 deletions
|
@ -45,17 +45,15 @@ volatile uint8_t USB_DeviceState;
|
|||
|
||||
void USB_USBTask(void)
|
||||
{
|
||||
#if defined(USB_HOST_ONLY)
|
||||
USB_HostTask();
|
||||
#elif defined(USB_DEVICE_ONLY)
|
||||
USB_DeviceTask();
|
||||
#else
|
||||
#if defined(USB_CAN_BE_BOTH)
|
||||
if (USB_CurrentMode == USB_MODE_Device)
|
||||
USB_DeviceTask();
|
||||
#if defined(USB_CAN_BE_HOST)
|
||||
else if (USB_CurrentMode == USB_MODE_Host)
|
||||
USB_HostTask();
|
||||
#endif
|
||||
#elif defined(USB_CAN_BE_HOST)
|
||||
USB_HostTask();
|
||||
#elif defined(USB_CAN_BE_DEVICE)
|
||||
USB_DeviceTask();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue