X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/9cec85bfd92a77a97e7d12625897de2682dfacd7..c20a94a4e84c89debf5e7109482ede708a694a0c:/Demos/Device/GenericHID/GenericHID.c?ds=inline diff --git a/Demos/Device/GenericHID/GenericHID.c b/Demos/Device/GenericHID/GenericHID.c index 245ddaafc..695342d0e 100644 --- a/Demos/Device/GenericHID/GenericHID.c +++ b/Demos/Device/GenericHID/GenericHID.c @@ -165,10 +165,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket) case REQ_GetReport: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { + uint8_t GenericData[GENERIC_REPORT_SIZE]; + Endpoint_ClearSETUP(); - uint8_t GenericData[GENERIC_REPORT_SIZE]; - CreateGenericHIDReport(GenericData); /* Write the report data to the control endpoint */ @@ -182,13 +182,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket) case REQ_SetReport: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { + uint8_t GenericData[GENERIC_REPORT_SIZE]; + Endpoint_ClearSETUP(); /* Wait until the generic report has been sent by the host */ while (!(Endpoint_IsOUTReceived())); - uint8_t GenericData[GENERIC_REPORT_SIZE]; - Endpoint_Read_Control_Stream_LE(&GenericData, sizeof(GenericData)); ProcessGenericHIDReport(GenericData);