1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

f4 usb: fix tracking of OUT requests with data stages

This code was mistakenly tracking the IN (device-to-host)
requests with data stages.  It should have been tracking
the OUT (host-to-device) requests with data stages.

This tracking data is important now that CDC is supported.
CDC actually uses OUT requests with data stages whereas HID
does not.  This bug only triggered once CDC was enabled.
This commit is contained in:
Stacey Sheldon 2013-03-15 23:50:54 -04:00 committed by Alessio Morale
parent b56f5206bd
commit 859734af98

View File

@ -342,7 +342,7 @@ static uint8_t PIOS_USBHOOK_CLASS_Setup(__attribute__((unused)) void *pdev, USB_
(usb_if_table[ifnum].ifops && usb_if_table[ifnum].ifops->setup)) { (usb_if_table[ifnum].ifops && usb_if_table[ifnum].ifops->setup)) {
usb_if_table[ifnum].ifops->setup(usb_if_table[ifnum].context, usb_if_table[ifnum].ifops->setup(usb_if_table[ifnum].context,
(struct usb_setup_request *)req); (struct usb_setup_request *)req);
if (req->bmRequest & 0x80 && req->wLength > 0) { if (!(req->bmRequest & 0x80) && req->wLength > 0) {
/* Request is a host-to-device data setup packet, keep track of the request details for the EP0_RxReady call */ /* Request is a host-to-device data setup packet, keep track of the request details for the EP0_RxReady call */
usb_ep0_active_req.bmRequestType = req->bmRequest; usb_ep0_active_req.bmRequestType = req->bmRequest;
usb_ep0_active_req.bRequest = req->bRequest; usb_ep0_active_req.bRequest = req->bRequest;