Fixed incorrect comparison in the descriptor callback routine of the TeensyHID bootlo...
[pub/USBasp.git] / LUFA / Drivers / Peripheral / SerialStream.c
index bf5474a..867160a 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
@@ -28,7 +28,7 @@
   this software.\r
 */\r
 \r
   this software.\r
 */\r
 \r
-#define  INCLUDE_FROM_SERIALSTREAM_C\r
+#define  __INCLUDE_FROM_SERIALSTREAM_C\r
 #include "SerialStream.h"\r
 \r
 FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW);\r
 #include "SerialStream.h"\r
 \r
 FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW);\r
@@ -44,6 +44,9 @@ static int SerialStream_TxByte(char DataByte, FILE *Stream)
 static int SerialStream_RxByte(FILE *Stream)\r
 {\r
        (void)Stream;\r
 static int SerialStream_RxByte(FILE *Stream)\r
 {\r
        (void)Stream;\r
+       \r
+       if (!(Serial_IsCharReceived()))\r
+         return _FDEV_EOF;\r
 \r
        return Serial_RxByte();\r
 }\r
 \r
        return Serial_RxByte();\r
 }\r