- /* Get the length of the pipe data, and create a new buffer to hold it */\r
- uint16_t BufferLength = Pipe_BytesInPipe();\r
- uint8_t Buffer[BufferLength];\r
- \r
- /* Read in the pipe data to the tempoary buffer */\r
- Pipe_Read_Stream_LE(Buffer, BufferLength);\r
- \r
+ /* Check if data is in the pipe */\r
+ if (Pipe_IsReadWriteAllowed())\r
+ {\r
+ /* Get the length of the pipe data, and create a new buffer to hold it */\r
+ uint16_t BufferLength = Pipe_BytesInPipe();\r
+ uint8_t Buffer[BufferLength];\r
+ \r
+ /* Read in the pipe data to the temporary buffer */\r
+ Pipe_Read_Stream_LE(Buffer, BufferLength);\r
+ \r
+ /* Print out the buffer contents to the USART */\r
+ for (uint16_t BufferByte = 0; BufferByte < BufferLength; BufferByte++)\r
+ putchar(Buffer[BufferByte]);\r
+ }\r
+\r