X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b71ff7c8cd68209a74c8690f4d190cc634ef8fb3..7aecda6fda5bcced68d72b0cf73d00174aa5c7cd:/Demos/Device/ClassDriver/GenericHID/GenericHID.c diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c index c27558b9e..9b906d571 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c @@ -42,9 +42,9 @@ uint8_t PrevHIDReportBuffer[GENERIC_REPORT_SIZE]; /** Structure to contain reports from the host, so that they can be echoed back upon request */ struct { - uint8_t ReportID; + uint8_t ReportID; uint16_t ReportSize; - uint8_t ReportData[GENERIC_REPORT_SIZE]; + uint8_t ReportData[GENERIC_REPORT_SIZE]; } HIDReportEcho; /** LUFA HID Class driver interface configuration and state information. This structure is @@ -55,13 +55,14 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface = { .Config = { - .InterfaceNumber = 0, + .InterfaceNumber = 0, - .ReportINEndpointNumber = GENERIC_IN_EPNUM, - .ReportINEndpointSize = GENERIC_EPSIZE, + .ReportINEndpointNumber = GENERIC_IN_EPNUM, + .ReportINEndpointSize = GENERIC_EPSIZE, + .ReportINEndpointDoubleBank = false, - .PrevReportINBuffer = PrevHIDReportBuffer, - .PrevReportINBufferSize = sizeof(PrevHIDReportBuffer), + .PrevReportINBuffer = PrevHIDReportBuffer, + .PrevReportINBufferSize = sizeof(PrevHIDReportBuffer), }, }; @@ -135,13 +136,14 @@ void EVENT_USB_Device_StartOfFrame(void) * * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID + * \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * * \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent */ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID, - void* ReportData, uint16_t* ReportSize) + const uint8_t ReportType, void* ReportData, uint16_t* ReportSize) { if (HIDReportEcho.ReportID) *ReportID = HIDReportEcho.ReportID;