diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-02-11 20:39:33 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-02-11 20:39:33 +0000 |
commit | 81bd8f2f83c0878f2f3ab3cdd73f284a1656c341 (patch) | |
tree | 57ee359ae5f01731c65823b777726a4147cf9aae /LUFA/Drivers/USB | |
parent | 2180f57d17a5589291eaf77db999f61a883ef3b6 (diff) | |
download | lufa-81bd8f2f83c0878f2f3ab3cdd73f284a1656c341.tar.gz lufa-81bd8f2f83c0878f2f3ab3cdd73f284a1656c341.tar.bz2 lufa-81bd8f2f83c0878f2f3ab3cdd73f284a1656c341.zip |
Clean up the Audio Device class driver control request Endpoint match logic.
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/AudioClassDevice.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c index 1bf1df458..1e91a6134 100644 --- a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c @@ -49,16 +49,13 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi } else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT) { - bool EndpointFilterMatch = false; - - EndpointFilterMatch |= (AudioInterfaceInfo->Config.DataINEndpointNumber && - ((uint8_t)USB_ControlRequest.wIndex == (ENDPOINT_DIR_IN | AudioInterfaceInfo->Config.DataINEndpointNumber))); - - EndpointFilterMatch |= (AudioInterfaceInfo->Config.DataOUTEndpointNumber && - ((uint8_t)USB_ControlRequest.wIndex == (ENDPOINT_DIR_OUT | AudioInterfaceInfo->Config.DataOUTEndpointNumber))); - - if (!(EndpointFilterMatch)) - return; + uint8_t EndpointIndex = (USB_ControlRequest.wIndex & 0xFF); + + if ((EndpointIndex != (ENDPOINT_DIR_IN | AudioInterfaceInfo->Config.DataINEndpointNumber)) && + (EndpointIndex != (ENDPOINT_DIR_OUT | AudioInterfaceInfo->Config.DataOUTEndpointNumber))) + { + return; + } } switch (USB_ControlRequest.bRequest) |