summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-09-29 16:18:17 +0700
committerhathach <[email protected]>2021-09-29 16:18:17 +0700
commit0b31c40b9f84e8207d78a3196a755be53356534f (patch)
treecc34cfc875b4943db073f37b81b2b04e4270cfd2 /src/class
parent2f2fb3d8d92f35c756d66db0eb256037f0a7d62f (diff)
parent32bdf3b79d27ed9f0851440df35b6a72bcd8bff8 (diff)
Merge branch 'master' into enhance
Diffstat (limited to 'src/class')
-rw-r--r--src/class/hid/hid_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c
index 2ee80750a..55071a5ce 100644
--- a/src/class/hid/hid_device.c
+++ b/src/class/hid/hid_device.c
@@ -282,7 +282,7 @@ bool hidd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t
uint8_t const report_id = tu_u16_low(request->wValue);
uint8_t* report_buf = p_hid->epin_buf;
- uint16_t req_len = request->wLength;
+ uint16_t req_len = tu_min16(request->wLength, CFG_TUD_HID_EP_BUFSIZE);
uint16_t xferlen = 0;
@@ -314,7 +314,7 @@ bool hidd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t
uint8_t const report_id = tu_u16_low(request->wValue);
uint8_t const* report_buf = p_hid->epout_buf;
- uint16_t report_len = request->wLength;
+ uint16_t report_len = tu_min16(request->wLength, CFG_TUD_HID_EP_BUFSIZE);
// If host request a specific Report ID, extract report ID in buffer before invoking callback
if ( (report_id != HID_REPORT_TYPE_INVALID) && (report_len > 1) && (report_id == report_buf[0]) )