summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-09-15 18:29:28 +0700
committerhathach <[email protected]>2021-09-15 18:29:28 +0700
commitf39656b6d7f1f005e2e17b535ddf5f9ad497b293 (patch)
treebae599c74ee9ccdb1dd23991d6781dec7bd09c8e /src/class
parent2998f67eacfb007806198a7d91cc1623ee966c2c (diff)
parent03866ddf9be007e8c26dc290e28093a9e59b1e17 (diff)
Merge branch 'master' of github.com:hathach/tinyusb into kkitayam-impl_close_all_for_khci
Diffstat (limited to 'src/class')
-rwxr-xr-xsrc/class/bth/bth_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/class/bth/bth_device.c b/src/class/bth/bth_device.c
index 1d27ae7c5..b73f829cc 100755
--- a/src/class/bth/bth_device.c
+++ b/src/class/bth/bth_device.c
@@ -214,14 +214,14 @@ bool btd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t c
}
else return false;
- return tud_control_xfer(rhport, request, &_btd_itf.hci_cmd, request->wLength);
+ return tud_control_xfer(rhport, request, &_btd_itf.hci_cmd, sizeof(_btd_itf.hci_cmd));
}
else if ( stage == CONTROL_STAGE_DATA )
{
// Handle class request only
TU_VERIFY(request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS);
- if (tud_bt_hci_cmd_cb) tud_bt_hci_cmd_cb(&_btd_itf.hci_cmd, request->wLength);
+ if (tud_bt_hci_cmd_cb) tud_bt_hci_cmd_cb(&_btd_itf.hci_cmd, tu_min16(request->wLength, sizeof(_btd_itf.hci_cmd)));
}
return true;