diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-06 14:32:01 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-06 14:32:01 +0000 |
commit | f29fc1abc40dd862689ca8765e244c1212742744 (patch) | |
tree | c415237396cc2bfdb7d63401ae5a3c6fb2ea2a0d /LUFA/Drivers/USB/Class | |
parent | f7ab433c67b86723385ec05ee9c7b96dd18e6dde (diff) | |
download | lufa-f29fc1abc40dd862689ca8765e244c1212742744.tar.gz lufa-f29fc1abc40dd862689ca8765e244c1212742744.tar.bz2 lufa-f29fc1abc40dd862689ca8765e244c1212742744.zip |
Add double banking property to LUFA powered projects in the Projects directory. Add guards to macro parameters to ensure that formulas passed as parameters don't mess up the internal macro structure.
Diffstat (limited to 'LUFA/Drivers/USB/Class')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/HID.c | 2 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/CDC.c | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c index 0bf1f7020..a9f1c9c81 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.c +++ b/LUFA/Drivers/USB/Class/Device/HID.c @@ -95,7 +95,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter {
Endpoint_ClearSETUP();
- HIDInterfaceInfo->State.UsingReportProtocol = (USB_ControlRequest.wValue != 0x0000);
+ HIDInterfaceInfo->State.UsingReportProtocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00);
Endpoint_ClearStatusStage();
}
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index 88d415614..aac0931b1 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -97,7 +97,8 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
{
Pipe_ConfigurePipe(CDCInterfaceInfo->Config.NotificationPipeNumber, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ CDCInterfaceInfo->Config.NotificationPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
CDCInterfaceInfo->State.NotificationPipeSize = EndpointData->EndpointSize;
Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);
@@ -110,7 +111,8 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
{
Pipe_ConfigurePipe(CDCInterfaceInfo->Config.DataINPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_IN,
- EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ CDCInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
CDCInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize;
FoundEndpoints |= CDC_FOUND_DATAPIPE_IN;
@@ -118,7 +120,8 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo else
{
Pipe_ConfigurePipe(CDCInterfaceInfo->Config.DataOUTPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ CDCInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
CDCInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize;
FoundEndpoints |= CDC_FOUND_DATAPIPE_OUT;
|