From 1730b497c95fa8b6d6089127b8fa374fd388ab7f Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Thu, 15 Mar 2018 20:10:36 -0500 Subject: [PATCH] Update stall state on set and clear feature Call USBDevice::endpoint_stall/unstall in the request to set/clear halt so the endpoint state is properly updated in the array _endpoint_info. --- usb/device/USBDevice/USBDevice.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usb/device/USBDevice/USBDevice.cpp b/usb/device/USBDevice/USBDevice.cpp index c724da23aa..f735ec90da 100644 --- a/usb/device/USBDevice/USBDevice.cpp +++ b/usb/device/USBDevice/USBDevice.cpp @@ -460,10 +460,10 @@ bool USBDevice::_request_set_feature() /* TODO: Remote wakeup feature not supported */ break; case ENDPOINT_RECIPIENT: - if (!EP_VALID(_transfer.setup.wIndex)) { + if (!EP_INDEXABLE(_transfer.setup.wIndex)) { break; } else if (_transfer.setup.wValue == ENDPOINT_HALT) { - _phy->endpoint_stall(_transfer.setup.wIndex); + endpoint_stall(_transfer.setup.wIndex); success = true; } break; @@ -492,10 +492,10 @@ bool USBDevice::_request_clear_feature() /* TODO: Remote wakeup feature not supported */ break; case ENDPOINT_RECIPIENT: - if (!EP_VALID(_transfer.setup.wIndex)) { + if (!EP_INDEXABLE(_transfer.setup.wIndex)) { break; } else if (_transfer.setup.wValue == ENDPOINT_HALT) { - _phy->endpoint_unstall(_transfer.setup.wIndex); + endpoint_unstall(_transfer.setup.wIndex); success = true; } break;