From 6a9d1eab2d38bfd524ae5397852c01cb03325559 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Fri, 24 Feb 2012 20:28:27 +0000 Subject: Modified the CDC Host demos to set a default CDC Line Encoding on enumerated devices. --- Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Demos/Host/ClassDriver') diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c index 36ff503f7..631925e45 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c @@ -163,6 +163,18 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); return; } + + VirtualSerial_CDC_Interface.State.LineEncoding.BaudRateBPS = 9600; + VirtualSerial_CDC_Interface.State.LineEncoding.CharFormat = CDC_LINEENCODING_OneStopBit; + VirtualSerial_CDC_Interface.State.LineEncoding.ParityType = CDC_PARITY_None; + VirtualSerial_CDC_Interface.State.LineEncoding.DataBits = 8; + + if (CDC_Host_SetLineEncoding(&VirtualSerial_CDC_Interface)) + { + puts_P(PSTR("Error Setting Device Line Encoding.\r\n")); + LEDs_SetAllLEDs(LEDMASK_USB_ERROR); + return; + } puts_P(PSTR("CDC Device Enumerated.\r\n")); LEDs_SetAllLEDs(LEDMASK_USB_READY); -- cgit v1.2.3