Fix up the ADC driver for the U4 parts to remove a typo on one of the register names.
[pub/USBasp.git] / Demos / Host / LowLevel / VirtualSerialHost / VirtualSerialHost.c
index bb47534..735ebba 100644 (file)
@@ -1,13 +1,13 @@
 /*\r
              LUFA Library\r
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
  \r
 #include "VirtualSerialHost.h"\r
 \r
  \r
 #include "VirtualSerialHost.h"\r
 \r
-#if 0\r
-/* NOTE: Here you can set up a standard stream using the created virtual serial port, so that the standard stream functions in\r
- *       <stdio.h> can be used on the virtual serial port (e.g. fprintf(&USBSerial, "Test"); to print a string).\r
- */\r
-       \r
-static int CDC_putchar(char c, FILE *stream)\r
-{        \r
-       Pipe_SelectPipe(CDC_DATAPIPE_OUT);\r
-       \r
-       if (Pipe_WaitUntilReady())\r
-         return -1;\r
-\r
-       Pipe_Write_Byte(c);\r
-       Pipe_ClearIN();\r
-       \r
-       return 0;\r
-}\r
-\r
-static int CDC_getchar(FILE *stream)\r
-{\r
-       int c;\r
-\r
-       Pipe_SelectPipe(CDC_DATAPIPE_IN);\r
-       \r
-       for (;;)\r
-       {\r
-               if (Pipe_WaitUntilReady())\r
-                 return -1;\r
-       \r
-               if (!(Pipe_BytesInPipe()))\r
-               {\r
-                       Pipe_ClearOUT();\r
-               }\r
-               else\r
-               {\r
-                       c = Pipe_Read_Byte();\r
-                       break;\r
-               }\r
-       }\r
-       \r
-       return c;\r
-}\r
-\r
-static FILE USBSerial = FDEV_SETUP_STREAM(CDC_putchar, CDC_getchar, _FDEV_SETUP_RW);\r
-#endif\r
-\r
 /** Main program entry point. This routine configures the hardware required by the application, then\r
  *  enters a loop to run the application tasks in sequence.\r
  */\r
 /** Main program entry point. This routine configures the hardware required by the application, then\r
  *  enters a loop to run the application tasks in sequence.\r
  */\r
@@ -92,6 +46,7 @@ int main(void)
        puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE));\r
 \r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
        puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE));\r
 \r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
+       sei();\r
 \r
        for (;;)\r
        {\r
 \r
        for (;;)\r
        {\r
@@ -218,7 +173,6 @@ void CDC_Host_Task(void)
                case HOST_STATE_Configured:\r
                        /* Select the data IN pipe */\r
                        Pipe_SelectPipe(CDC_DATAPIPE_IN);\r
                case HOST_STATE_Configured:\r
                        /* Select the data IN pipe */\r
                        Pipe_SelectPipe(CDC_DATAPIPE_IN);\r
-                       Pipe_SetPipeToken(PIPE_TOKEN_IN);\r
                        Pipe_Unfreeze();\r
 \r
                        /* Check to see if a packet has been received */\r
                        Pipe_Unfreeze();\r
 \r
                        /* Check to see if a packet has been received */\r