diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-09-02 13:08:55 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-09-02 13:08:55 +0000 |
commit | 6783bc4594177833d2b1047d77316e38cfe6a629 (patch) | |
tree | 192e7b44b6e0ff87d1cd5108c2d2b4d318e90eb7 /LUFA/Drivers/USB/Class/Host/CDC.c | |
parent | 205b35d131a1cc8196786de4370cb90fec17835e (diff) | |
download | lufa-6783bc4594177833d2b1047d77316e38cfe6a629.tar.gz lufa-6783bc4594177833d2b1047d77316e38cfe6a629.tar.bz2 lufa-6783bc4594177833d2b1047d77316e38cfe6a629.zip |
Add StillImage Host Class Driver functions for opening and closing sessions. Ensure IsActive is set on the interface to allow device functions to run.
Fix spelling of "Received" in all source files where it is misspelt "Recieved".
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/CDC.c')
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/CDC.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index cb70808a1..68dddeacb 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -131,7 +131,7 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint }
}
- CDCInterfaceInfo->State.Active = true;
+ CDCInterfaceInfo->State.IsActive = true;
return CDC_ENUMERROR_NoError;
}
@@ -196,7 +196,7 @@ static uint8_t DComp_CDC_Host_NextCDCInterfaceEndpoint(void* CurrentDescriptor) void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo)
{
- if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.Active))
+ if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return;
Pipe_SelectPipe(CDCInterfaceInfo->Config.NotificationPipeNumber);
@@ -258,7 +258,7 @@ uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* CDCInterfa uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Data, uint16_t Length)
{
- if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.Active))
+ if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return;
uint8_t ErrorCode;
@@ -273,10 +273,10 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Da uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint8_t Data)
{
- if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.Active))
+ if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return;
- uint8_t ErrorCode = PIPE_READYWAIT_NoError;
+ uint8_t ErrorCode;
Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
@@ -284,20 +284,22 @@ uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint8_t Da if (!(Pipe_IsReadWriteAllowed()))
{
Pipe_ClearOUT();
- ErrorCode = Pipe_WaitUntilReady();
+
+ if ((ErrorCode = Pipe_WaitUntilReady()) != PIPE_READYWAIT_NoError)
+ return ErrorCode;
}
Pipe_Write_Byte(Data);
Pipe_Freeze();
- return ErrorCode;
+ return PIPE_READYWAIT_NoError;
}
uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo)
{
uint16_t BytesInPipe = 0;
- if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.Active))
+ if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return BytesInPipe;
Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipeNumber);
@@ -316,7 +318,7 @@ uint8_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo) {
uint8_t ReceivedByte = 0;
- if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.Active))
+ if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return ReceivedByte;
Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipeNumber);
|