diff options
| author | Dean Camera <dean@fourwalledcubicle.com> | 2010-04-14 13:46:49 +0000 |
|---|---|---|
| committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-04-14 13:46:49 +0000 |
| commit | 5e14c194c9a2f5cb52a43f7efeacb795a38ced74 (patch) | |
| tree | bc07188cadeddeb919e18764eb3aca89bf3d9954 /LUFA/Drivers/USB/LowLevel/DevChapter9.c | |
| parent | 7b79325aa037db9786f0da069c11315a3f6d9721 (diff) | |
| download | lufa-5e14c194c9a2f5cb52a43f7efeacb795a38ced74.tar.gz lufa-5e14c194c9a2f5cb52a43f7efeacb795a38ced74.tar.bz2 lufa-5e14c194c9a2f5cb52a43f7efeacb795a38ced74.zip | |
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.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel/DevChapter9.c')
| -rw-r--r-- | LUFA/Drivers/USB/LowLevel/DevChapter9.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/DevChapter9.c b/LUFA/Drivers/USB/LowLevel/DevChapter9.c index 7d9e81502..17a5fd471 100644 --- a/LUFA/Drivers/USB/LowLevel/DevChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/DevChapter9.c @@ -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();
}
}
|
