diff options
| author | Zachery Littell <[email protected]> | 2020-10-07 20:36:00 -0500 |
|---|---|---|
| committer | Zachery Littell <[email protected]> | 2020-10-07 20:36:00 -0500 |
| commit | db3fe97f62f22747df2c79a841bc1fb235f2f89e (patch) | |
| tree | acb71a17e78fa4b7ef6cfbfec7087c209cdbd0bf /examples/device | |
| parent | 081af79009dc40ab41be9976d22629c7d251a50d (diff) | |
fix variable names. add itf n callbacks to multihid
Diffstat (limited to 'examples/device')
| -rw-r--r-- | examples/device/hid_multipleinterface/src/main.c | 6 | ||||
| -rw-r--r-- | examples/device/hid_multipleinterface/src/usb_descriptors.c | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/examples/device/hid_multipleinterface/src/main.c b/examples/device/hid_multipleinterface/src/main.c index 2efb1f5cb..b1957b9fc 100644 --- a/examples/device/hid_multipleinterface/src/main.c +++ b/examples/device/hid_multipleinterface/src/main.c @@ -167,9 +167,10 @@ void hid_task(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 -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_n_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen) { // TODO not Implemented + (void) itf; (void) report_id; (void) report_type; (void) buffer; @@ -180,9 +181,10 @@ uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, // Invoked when received SET_REPORT control request or // received data on OUT endpoint ( Report ID = 0, Type = 0 ) -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_n_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) { // TODO set LED based on CAPLOCK, NUMLOCK etc... + (void) itf; (void) report_id; (void) report_type; (void) buffer; diff --git a/examples/device/hid_multipleinterface/src/usb_descriptors.c b/examples/device/hid_multipleinterface/src/usb_descriptors.c index a1a98c773..396d22621 100644 --- a/examples/device/hid_multipleinterface/src/usb_descriptors.c +++ b/examples/device/hid_multipleinterface/src/usb_descriptors.c @@ -83,13 +83,13 @@ uint8_t desc_hid_report2[] = // 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(uint8_t desc_index) +uint8_t const * tud_hid_n_descriptor_report_cb(uint8_t itf) { - if (desc_index == 0) + if (itf == 0) { return desc_hid_report1; } - else if (desc_index == 1) + else if (itf == 1) { return desc_hid_report2; } |
