Add the missing argument to the HID functions

This commit is contained in:
Kamil Tomaszewski 2021-02-24 19:09:17 +01:00
parent dafdd246bc
commit ef3a61432b
2 changed files with 7 additions and 4 deletions

View File

@ -73,7 +73,8 @@ static usb_hid_device_obj_t* get_hid_device(uint8_t report_id) {
}
// Callbacks invoked when receive Get_Report request through control endpoint
uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen) {
uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen) {
(void) itf;
// only support Input Report
if ( report_type != HID_REPORT_TYPE_INPUT ) return 0;
@ -83,7 +84,8 @@ uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type,
}
// Callbacks invoked when receive Set_Report request through control endpoint
void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) {
void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) {
(void) itf;
if (report_type == HID_REPORT_TYPE_INVALID) {
report_id = buffer[0];
buffer++;

View File

@ -47,8 +47,9 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index) {
// Invoked when received GET HID REPORT DESCRIPTOR
// Application return pointer to descriptor
// Descriptor contents must exist long enough for transfer to complete
uint8_t const * tud_hid_descriptor_report_cb(void) {
return hid_report_descriptor;
uint8_t const * tud_hid_descriptor_report_cb(uint8_t itf) {
(void) itf;
return hid_report_descriptor;
}
#endif