From b48095c0fbd9774413702b0226ef72926034e6c6 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Fri, 24 Sep 2010 06:34:43 +0000 Subject: Fixed endpoint selection within the CALLBACK_HID_Device_CreateHIDReport() callback function causing broken GET REPORT requests. Minor whitespace fixes. --- LUFA/Drivers/USB/Class/Device/HID.c | 5 +++-- LUFA/Drivers/USB/LowLevel/Endpoint.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'LUFA/Drivers/USB') diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c index e38d35a5a..1953d9fbc 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.c +++ b/LUFA/Drivers/USB/Class/Device/HID.c @@ -60,8 +60,9 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter if (HIDInterfaceInfo->Config.PrevReportINBuffer != NULL) memcpy(HIDInterfaceInfo->Config.PrevReportINBuffer, ReportData, HIDInterfaceInfo->Config.PrevReportINBufferSize); - Endpoint_ClearSETUP(); Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + + Endpoint_ClearSETUP(); Endpoint_Write_Control_Stream_LE(ReportData, ReportSize); Endpoint_ClearOUT(); } @@ -77,7 +78,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter Endpoint_ClearSETUP(); Endpoint_Read_Control_Stream_LE(ReportData, ReportSize); - Endpoint_ClearIN(); + Endpoint_ClearIN(); CALLBACK_HID_Device_ProcessHIDReport(HIDInterfaceInfo, ReportID, ReportType, ReportData, ReportSize); } diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h index 2a8344b4c..d7dbc3e9a 100644 --- a/LUFA/Drivers/USB/LowLevel/Endpoint.h +++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h @@ -451,7 +451,7 @@ static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline bool Endpoint_IsINReady(void) { - return ((UEINTX & (1 << TXINI)) ? true : false); + return ((UEINTX & (1 << TXINI)) ? true : false); } /** Determines if the selected OUT endpoint has received new packet. -- cgit v1.2.3