diff options
Diffstat (limited to 'Demos/Host/CDCHost')
-rw-r--r-- | Demos/Host/CDCHost/CDCHost.c | 44 | ||||
-rw-r--r-- | Demos/Host/CDCHost/CDCHost.h | 1 | ||||
-rw-r--r-- | Demos/Host/CDCHost/ConfigDescriptor.h | 1 |
3 files changed, 21 insertions, 25 deletions
diff --git a/Demos/Host/CDCHost/CDCHost.c b/Demos/Host/CDCHost/CDCHost.c index 9ecf060b3..80d993953 100644 --- a/Demos/Host/CDCHost/CDCHost.c +++ b/Demos/Host/CDCHost/CDCHost.c @@ -36,12 +36,6 @@ #include "CDCHost.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA CDC Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -244,33 +238,37 @@ TASK(USB_CDC_Host) /* Select and the data IN pipe */
Pipe_SelectPipe(CDC_DATAPIPE_IN);
- /* Check if data is in the pipe */
- if (Pipe_ReadWriteAllowed())
+ /* Check to see if a packet has been received */
+ if (Pipe_IsINReceived())
{
- /* Get the length of the pipe data, and create a new buffer to hold it */
- uint16_t BufferLength = Pipe_BytesInPipe();
- uint8_t Buffer[BufferLength];
-
- /* Read in the pipe data to the temporary buffer */
- Pipe_Read_Stream_LE(Buffer, BufferLength);
-
+ /* Check if data is in the pipe */
+ if (Pipe_IsReadWriteAllowed())
+ {
+ /* Get the length of the pipe data, and create a new buffer to hold it */
+ uint16_t BufferLength = Pipe_BytesInPipe();
+ uint8_t Buffer[BufferLength];
+
+ /* Read in the pipe data to the temporary buffer */
+ Pipe_Read_Stream_LE(Buffer, BufferLength);
+
+ /* Print out the buffer contents to the USART */
+ for (uint16_t BufferByte = 0; BufferByte < BufferLength; BufferByte++)
+ putchar(Buffer[BufferByte]);
+ }
+
/* Clear the pipe after it is read, ready for the next packet */
- Pipe_ClearCurrentBank();
-
- /* Print out the buffer contents to the USART */
- for (uint16_t BufferByte = 0; BufferByte < BufferLength; BufferByte++)
- putchar(Buffer[BufferByte]);
+ Pipe_ClearIN();
}
/* Select and unfreeze the notification pipe */
Pipe_SelectPipe(CDC_NOTIFICATIONPIPE);
Pipe_Unfreeze();
- /* Check if data is in the pipe */
- if (Pipe_ReadWriteAllowed())
+ /* Check if a packet has been received */
+ if (Pipe_IsINReceived())
{
/* Discard the event notification */
- Pipe_ClearCurrentBank();
+ Pipe_ClearIN();
}
/* Freeze notification IN pipe after use */
diff --git a/Demos/Host/CDCHost/CDCHost.h b/Demos/Host/CDCHost/CDCHost.h index 21b9d67ed..c348acaef 100644 --- a/Demos/Host/CDCHost/CDCHost.h +++ b/Demos/Host/CDCHost/CDCHost.h @@ -44,7 +44,6 @@ #include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
diff --git a/Demos/Host/CDCHost/ConfigDescriptor.h b/Demos/Host/CDCHost/ConfigDescriptor.h index 9db4b6505..ea00f610f 100644 --- a/Demos/Host/CDCHost/ConfigDescriptor.h +++ b/Demos/Host/CDCHost/ConfigDescriptor.h @@ -38,7 +38,6 @@ /* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "CDCHost.h"
|