diff options
| author | hathach <[email protected]> | 2021-05-13 12:27:09 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-05-18 12:58:24 +0700 |
| commit | 7305fec4db13e846aa945b26d18418ec1e5e4ce7 (patch) | |
| tree | 5777b01726f09d502a6adbc223c8a5770a4bc131 /src/class | |
| parent | db8ea7ea1c48a04fff6446df294123690dcb7012 (diff) | |
change hid device report len from uint8 to uint16
Diffstat (limited to 'src/class')
| -rw-r--r-- | src/class/hid/hid_device.c | 6 | ||||
| -rw-r--r-- | src/class/hid/hid_device.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index 18d35bc20..ccd47a290 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -76,7 +76,7 @@ bool tud_hid_n_ready(uint8_t itf) return tud_ready() && (ep_in != 0) && !usbd_edpt_busy(TUD_OPT_RHPORT, ep_in); } -bool tud_hid_n_report(uint8_t itf, uint8_t report_id, void const* report, uint8_t len) +bool tud_hid_n_report(uint8_t itf, uint8_t report_id, void const* report, uint16_t len) { uint8_t const rhport = 0; hidd_interface_t * p_hid = &_hidd_itf[itf]; @@ -87,7 +87,7 @@ bool tud_hid_n_report(uint8_t itf, uint8_t report_id, void const* report, uint8_ // prepare data if (report_id) { - len = tu_min8(len, CFG_TUD_HID_EP_BUFSIZE-1); + len = tu_min16(len, CFG_TUD_HID_EP_BUFSIZE-1); p_hid->epin_buf[0] = report_id; memcpy(p_hid->epin_buf+1, report, len); @@ -95,7 +95,7 @@ bool tud_hid_n_report(uint8_t itf, uint8_t report_id, void const* report, uint8_ }else { // If report id = 0, skip ID field - len = tu_min8(len, CFG_TUD_HID_EP_BUFSIZE); + len = tu_min16(len, CFG_TUD_HID_EP_BUFSIZE); memcpy(p_hid->epin_buf, report, len); } diff --git a/src/class/hid/hid_device.h b/src/class/hid/hid_device.h index 7520d3453..a36f7e623 100644 --- a/src/class/hid/hid_device.h +++ b/src/class/hid/hid_device.h @@ -61,7 +61,7 @@ bool tud_hid_n_ready(uint8_t itf); bool tud_hid_n_boot_mode(uint8_t itf); // Send report to host -bool tud_hid_n_report(uint8_t itf, uint8_t report_id, void const* report, uint8_t len); +bool tud_hid_n_report(uint8_t itf, uint8_t report_id, void const* report, uint16_t len); // KEYBOARD: convenient helper to send keyboard report if application // use template layout report as defined by hid_keyboard_report_t @@ -128,7 +128,7 @@ static inline bool tud_hid_boot_mode(void) return tud_hid_n_boot_mode(0); } -static inline bool tud_hid_report(uint8_t report_id, void const* report, uint8_t len) +static inline bool tud_hid_report(uint8_t report_id, void const* report, uint16_t len) { return tud_hid_n_report(0, report_id, report, len); } |
