diff options
| author | hathach <[email protected]> | 2019-05-12 14:09:35 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-05-12 14:09:35 +0700 |
| commit | ba2136486c153edd372eadaa325dab27fe1297b2 (patch) | |
| tree | d30de0dbfb87172da850733d88cf08ec9751e69e /src/class/hid | |
| parent | de56a0ca8987c15c06112ece2589dab18f1d6666 (diff) | |
add tud_hid_descriptor_report_cb()
- remove tud_desc_set.hid_report
- remove tud_desc_set_t
Diffstat (limited to 'src/class/hid')
| -rw-r--r-- | src/class/hid/hid_device.c | 3 | ||||
| -rw-r--r-- | src/class/hid/hid_device.h | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index e82932e1f..1c971a606 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -201,7 +201,8 @@ bool hidd_control_request(uint8_t rhport, tusb_control_request_t const * p_reque if (p_request->bRequest == TUSB_REQ_GET_DESCRIPTOR && desc_type == HID_DESC_TYPE_REPORT)
{
- usbd_control_xfer(rhport, p_request, (void*) tud_desc_set.hid_report, p_hid->reprot_desc_len);
+ uint8_t const * desc_report = tud_hid_descriptor_report_cb();
+ usbd_control_xfer(rhport, p_request, (void*) desc_report, p_hid->reprot_desc_len);
}else
{
return false; // stall unsupported request
diff --git a/src/class/hid/hid_device.h b/src/class/hid/hid_device.h index 825be2181..9becab148 100644 --- a/src/class/hid/hid_device.h +++ b/src/class/hid/hid_device.h @@ -68,6 +68,11 @@ bool tud_hid_mouse_report(uint8_t report_id, uint8_t buttons, int8_t x, int8_t y // Callbacks (Weak is optional)
//--------------------------------------------------------------------+
+// 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);
+
// Invoked when received GET_REPORT control request
// Application must fill buffer report's content and return its length.
// Return zero will cause the stack to STALL request
|
