diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index 04ea31326..b4c75e3fb 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -237,7 +237,7 @@ bool hidd_control_request(uint8_t rhport, tusb_control_request_t const * request } else if (request->bRequest == TUSB_REQ_GET_DESCRIPTOR && desc_type == HID_DESC_TYPE_REPORT) { - uint8_t const * desc_report = tud_hid_descriptor_report_cb(); + uint8_t const * desc_report = tud_hid_descriptor_report_cb((uint8_t) request->wIndex); tud_control_xfer(rhport, request, (void*) desc_report, p_hid->report_desc_len); } else diff --git a/src/class/hid/hid_device.h b/src/class/hid/hid_device.h index e6961515c..1873c4f09 100644 --- a/src/class/hid/hid_device.h +++ b/src/class/hid/hid_device.h @@ -86,7 +86,8 @@ static inline bool tud_hid_mouse_report(uint8_t report_id, uint8_t buttons, int8 // Invoked when received GET HID REPORT DESCRIPTOR request // Application return pointer to descriptor, whose contents must exist long enough for transfer to complete -uint8_t const * tud_hid_descriptor_report_cb(void); +// TODO Talk about this change... because it is breaking. Might be better way to handle. +uint8_t const * tud_hid_descriptor_report_cb(uint8_t desc_index); // Invoked when received GET_REPORT control request // Application must fill buffer report's content and return its length.