X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/cf22a744ec0da3b68c4ffdb14c6fa43f2e07542f..f79f9abd28040d839b02ea22cdfde3d0a34f3482:/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c index c4322587e..588198bb4 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c @@ -1,21 +1,21 @@ /* 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) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -30,57 +30,11 @@ /** \file * - * Main source file for the CDCHost demo. This file contains the main tasks of + * Main source file for the VirtualSerialHost demo. This file contains the main tasks of * the demo and is responsible for the initial application hardware configuration. */ -#include "CDCHost.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 +#include "VirtualSerialHost.h" /** 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 */