X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d4ca7fb44c7d326b96cf391f0275dc323dbe24de..f79f9abd28040d839b02ea22cdfde3d0a34f3482:/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c index bb4753404..588198bb4 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2010 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 @@ -36,52 +36,6 @@ #include "VirtualSerialHost.h" -#if 0 -/* NOTE: Here you can set up a standard stream using the created virtual serial port, so that the standard stream functions in - * can be used on the virtual serial port (e.g. fprintf(&USBSerial, "Test"); to print a string). - */ - -static int CDC_putchar(char c, FILE *stream) -{ - Pipe_SelectPipe(CDC_DATAPIPE_OUT); - - if (Pipe_WaitUntilReady()) - return -1; - - Pipe_Write_Byte(c); - Pipe_ClearIN(); - - return 0; -} - -static int CDC_getchar(FILE *stream) -{ - int c; - - Pipe_SelectPipe(CDC_DATAPIPE_IN); - - for (;;) - { - if (Pipe_WaitUntilReady()) - return -1; - - if (!(Pipe_BytesInPipe())) - { - Pipe_ClearOUT(); - } - else - { - c = Pipe_Read_Byte(); - break; - } - } - - return c; -} - -static FILE USBSerial = FDEV_SETUP_STREAM(CDC_putchar, CDC_getchar, _FDEV_SETUP_RW); -#endif - /** Main program entry point. This routine configures the hardware required by the application, then * enters a loop to run the application tasks in sequence. */ @@ -218,7 +172,6 @@ void CDC_Host_Task(void) case HOST_STATE_Configured: /* Select the data IN pipe */ Pipe_SelectPipe(CDC_DATAPIPE_IN); - Pipe_SetPipeToken(PIPE_TOKEN_IN); Pipe_Unfreeze(); /* Check to see if a packet has been received */