Add extra LUFA TAR archive export exclusions.
[pub/USBasp.git] / Demos / Host / ClassDriver / VirtualSerialHost / VirtualSerialHost.c
index 72d7e58..631925e 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -62,7 +62,7 @@ USB_ClassInfo_CDC_Host_t VirtualSerial_CDC_Interface =
 int main(void)
 {
        SetupHardware();
 int main(void)
 {
        SetupHardware();
-       
+
        puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE));
 
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
        puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE));
 
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -163,6 +163,18 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
                return;
        }
                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);
 
        puts_P(PSTR("CDC Device Enumerated.\r\n"));
        LEDs_SetAllLEDs(LEDMASK_USB_READY);