mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-13 20:34:17 +00:00
Use an early-abort in the USB_DeviceTask() function rather than wrapping the entire implementation in a conditional.
This commit is contained in:
parent
c4aeb6d5ab
commit
b9f3ff39a4
@ -60,8 +60,9 @@ void USB_USBTask(void)
|
||||
#if defined(USB_CAN_BE_DEVICE)
|
||||
static void USB_DeviceTask(void)
|
||||
{
|
||||
if (USB_DeviceState != DEVICE_STATE_Unattached)
|
||||
{
|
||||
if (USB_DeviceState == DEVICE_STATE_Unattached)
|
||||
return;
|
||||
|
||||
uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
|
||||
|
||||
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
|
||||
@ -71,7 +72,6 @@ static void USB_DeviceTask(void)
|
||||
|
||||
Endpoint_SelectEndpoint(PrevEndpoint);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USB_CAN_BE_HOST)
|
||||
|
Loading…
Reference in New Issue
Block a user