Endpoint_SelectEndpoint(EndpointIndex);
- if (!(Endpoint_IsEnabled()))
- return;
-
- if (USB_ControlRequest.bRequest == REQ_SetFeature)
- {
- Endpoint_StallTransaction();
- }
- else
- {
- Endpoint_ClearStall();
- Endpoint_ResetFIFO(EndpointIndex);
- Endpoint_ResetDataToggle();
+ if (Endpoint_IsEnabled())
+ {
+ if (USB_ControlRequest.bRequest == REQ_SetFeature)
+ {
+ Endpoint_StallTransaction();
+ }
+ else
+ {
+ Endpoint_ClearStall();
+ Endpoint_ResetFIFO(EndpointIndex);
+ Endpoint_ResetDataToggle();
+ }
}
}
if (Endpoint_IsINReady())
{
- uint8_t BytesInEndpoint = Endpoint_BytesInEndpoint();
+ uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint();
while (Length && (BytesInEndpoint < USB_ControlEndpointSize))
{
USB_INT_Enable(USB_INT_VBUS);
#endif
- #if defined(CONTROL_ONLY_DEVICE)
- UENUM = ENDPOINT_CONTROLEP;
- #endif
+ Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
+ ENDPOINT_DIR_OUT, USB_ControlEndpointSize,
+ ENDPOINT_BANK_SINGLE);
}
else if (USB_CurrentMode == USB_MODE_HOST)
{
* request handler
* - Fixed LowLevel PrinterHost demo not sending control requests to the attached printer with the correct printer interface wIndex value
* - Added LEDs_ToggleLEDs() function to several board LED drivers which were missing it (thanks to Andrei Krainev)
+ * - Fixed SET FEATURE and CLEAR FEATURE control requests directed at an unconfigured endpoint causing request timeouts
*
* \section Sec_ChangeLog100807 Version 100807
* <b>New:</b>