Fixed incorrect definitions of HID_KEYBOARD_LED_KANA, HID_KEYBOARD_SC_KEYPAD_EQUAL_SI...
[pub/USBasp.git] / LUFA / Drivers / Peripheral / AVR8 / Serial_AVR8.c
index 4c2f1ae..445b7c7 100644 (file)
@@ -18,7 +18,7 @@
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
-  The author disclaim all warranties with regard to this
+  The author disclaims all warranties with regard to this
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
@@ -28,6 +28,9 @@
   this software.
 */
 
   this software.
 */
 
+#include "../../../Common/Common.h"
+#if (ARCH == ARCH_AVR8)
+
 #define  __INCLUDE_FROM_SERIAL_C
 #include "../Serial.h"
 
 #define  __INCLUDE_FROM_SERIAL_C
 #include "../Serial.h"
 
@@ -89,3 +92,28 @@ void Serial_SendData(const uint8_t* Buffer,
          Serial_SendByte(*(Buffer++));
 }
 
          Serial_SendByte(*(Buffer++));
 }
 
+void Serial_CreateStream(FILE* Stream)
+{
+       if (!(Stream))
+       {
+               Stream = &USARTSerialStream;
+               stdin  = Stream;
+               stdout = Stream;
+       }
+
+       *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW);
+}
+
+void Serial_CreateBlockingStream(FILE* Stream)
+{
+       if (!(Stream))
+       {
+               Stream = &USARTSerialStream;
+               stdin  = Stream;
+               stdout = Stream;
+       }
+
+       *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW);
+}
+
+#endif