X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/f4814771d2544cc53098fc8c13657eb41e9e9401..a2001ac1ccf4d4919c8243fbc69aff0b68973d3f:/LUFA/Drivers/USB/Class/Host/HID.c?ds=inline diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index 3a4faffbd..a42f8afa3 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -127,11 +127,21 @@ void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo) } -void HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo) +bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo) { + bool ReportReceived; + + if ((USB_HostState != HOST_STATE_Configured) || !(HIDInterfaceInfo->State.Active)) + return false; + Pipe_SelectPipe(HIDInterfaceInfo->Config.DataINPipeNumber); + Pipe_Unfreeze(); + + ReportReceived = Pipe_IsReadWriteAllowed(); + + Pipe_Freeze(); - return Pipe_IsReadWriteAllowed(); + return ReportReceived; } #endif