aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-04 08:06:26 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-04 08:06:26 +0000
commiteff07bb87758a12064d9de9c859b1e6e6502f2ea (patch)
tree1849b829b24d4c088fa97501d4cbfe63fd53ef13 /LUFA
parent5c069f909a844caa921e643d2b7d52ad61f544f6 (diff)
downloadlufa-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')
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDC.c6
-rw-r--r--LUFA/ManPages/ChangeLog.txt2
2 files changed, 5 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);
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index ec2236a2c..cdd2333d2 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -58,6 +58,8 @@
* internal control
* - Interrupts are no longer disabled during the processing of Control Requests on the default endpoint while in device mode
* - AudioOutput demos now always output to board LEDs, regardless of output mode (removed AUDIO_OUT_LEDS project option)
+ * - Removed SINGLE_DEVICE_CONFIGURATION compile time option in favour of the new FIXED_NUM_CONFIGURATIONS option so that the exact number
+ * of device configurations can be defined statically
*
* <b>Fixed:</b>
* - Changed bootloaders to use FLASHEND rather than the existence of RAMPZ to determine if far FLASH pointers are needed to fix