This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 5b817d6 tinyusb: Fix COMPATIBILITY_FEATURE_REQUEST handling
5b817d6 is described below
commit 5b817d645f819226f881d6cbc510e0ae801ba865
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Thu Dec 2 09:18:25 2021 +0100
tinyusb: Fix COMPATIBILITY_FEATURE_REQUEST handling
Transfer on control point was started regardless of stage.
Transfer should only be started in CONTROL_STAGE_SETUP in other
stages function should return true.
Despite incorrect behavior NRF5x based MCUs were working fine,
but DA1469x was not.
---
hw/usb/tinyusb/std_descriptors/src/std_descriptors.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/usb/tinyusb/std_descriptors/src/std_descriptors.c
b/hw/usb/tinyusb/std_descriptors/src/std_descriptors.c
index 1691f1d..ac3a0db 100755
--- a/hw/usb/tinyusb/std_descriptors/src/std_descriptors.c
+++ b/hw/usb/tinyusb/std_descriptors/src/std_descriptors.c
@@ -300,7 +300,11 @@ bool
tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, const
tusb_control_request_t *request)
{
if (request->wIndex == 0x04 && request->bRequest ==
COMPATIBILITY_FEATURE_REQUEST) {
- return tud_control_xfer(rhport, request, (void *)&windows_compat_id,
40);
+ if (stage == CONTROL_STAGE_SETUP) {
+ return tud_control_xfer(rhport, request, (void
*)&windows_compat_id, 40);
+ } else {
+ return true;
+ }
}
return false;
}