diff options
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/HIDClassDevice.c | 5 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/HIDClassDevice.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c index d756b092e..5c8d878e7 100644 --- a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c @@ -156,6 +156,9 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) if (USB_DeviceState != DEVICE_STATE_Configured) return; + if (HIDInterfaceInfo->State.PrevFrameNum == USB_Device_GetFrameNumber()) + return; + Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber); if (Endpoint_IsReadWriteAllowed()) @@ -190,6 +193,8 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) Endpoint_ClearIN(); } + + HIDInterfaceInfo->State.PrevFrameNum = USB_Device_GetFrameNumber(); } } diff --git a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h index ab86da452..95389f371 100644 --- a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h @@ -113,6 +113,7 @@ struct { bool UsingReportProtocol; /**< Indicates if the HID interface is set to Boot or Report protocol mode. */ + uint16_t PrevFrameNum; /**< Frame number of the previous HID report packet opportunity. */ uint16_t IdleCount; /**< Report idle period, in milliseconds, set by the host. */ uint16_t IdleMSRemaining; /**< Total number of milliseconds remaining before the idle period elapsed - this * should be decremented by the user application if non-zero each millisecond. */ |