Fixed Set/Clear Feature requests directed to a non-configured endpoint not returning a stall to the host.

Make TeensyHID bootloader use an 8 byte control endpoint to match the official Teensy, just in case Paul decides to authenticate on that attribute in the future.
This commit is contained in:
Dean Camera 2010-04-14 13:46:49 +00:00
parent 7b79325aa0
commit 5e14c194c9
5 changed files with 18 additions and 17 deletions

View file

@ -323,7 +323,7 @@ static void USB_Device_GetStatus(void)
#endif
#if !defined(CONTROL_ONLY_DEVICE)
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):
Endpoint_SelectEndpoint(USB_ControlRequest.wIndex & 0xFF);
Endpoint_SelectEndpoint((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);
CurrentStatus = Endpoint_IsStalled();
@ -344,7 +344,7 @@ static void USB_Device_GetStatus(void)
}
static void USB_Device_ClearSetFeature(void)
{
{
switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT)
{
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
@ -367,18 +367,18 @@ static void USB_Device_ClearSetFeature(void)
Endpoint_SelectEndpoint(EndpointIndex);
if (Endpoint_IsEnabled())
{
if (USB_ControlRequest.bRequest == REQ_SetFeature)
{
Endpoint_StallTransaction();
}
else
{
Endpoint_ClearStall();
Endpoint_ResetFIFO(EndpointIndex);
Endpoint_ResetDataToggle();
}
if (!(Endpoint_IsEnabled()))
return;
if (USB_ControlRequest.bRequest == REQ_SetFeature)
{
Endpoint_StallTransaction();
}
else
{
Endpoint_ClearStall();
Endpoint_ResetFIFO(EndpointIndex);
Endpoint_ResetDataToggle();
}
}