diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-04 08:06:26 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-04 08:06:26 +0000 |
commit | eff07bb87758a12064d9de9c859b1e6e6502f2ea (patch) | |
tree | 1849b829b24d4c088fa97501d4cbfe63fd53ef13 /LUFA/Drivers/USB | |
parent | 5c069f909a844caa921e643d2b7d52ad61f544f6 (diff) | |
download | lufa-eff07bb87758a12064d9de9c859b1e6e6502f2ea.tar.gz lufa-eff07bb87758a12064d9de9c859b1e6e6502f2ea.tar.bz2 lufa-eff07bb87758a12064d9de9c859b1e6e6502f2ea.zip |
Fix issue with CDC device demos causing broken communications when the device tries to send data before the host has set the line encoding.
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/CDC.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index 0359afe4d..9ed20e484 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -139,16 +139,16 @@ void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo) void CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, char* const Data, const uint16_t Length)
{
- if (USB_DeviceState != DEVICE_STATE_Configured)
+ if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return;
-
+
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_Write_Stream_LE(Data, Length, NO_STREAM_CALLBACK);
}
void CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Data)
{
- if (USB_DeviceState != DEVICE_STATE_Configured)
+ if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
|