Fix issue with CDC device demos causing broken communications when the device tries to send data before the host has set the line encoding.

This commit is contained in:
Dean Camera 2009-08-04 08:06:26 +00:00
parent 5c069f909a
commit eff07bb877
3 changed files with 22 additions and 5 deletions

View file

@ -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);

View file

@ -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