Update code and StaticAnlysisTest so that missingInclude warnings do not have to...
[pub/USBasp.git] / LUFA / Drivers / Peripheral / AVR8 / Serial_AVR8.c
index 05d163c..f391c06 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 /*
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  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
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -82,9 +82,33 @@ void Serial_SendString(const char* StringPtr)
        }
 }
 
        }
 }
 
-void Serial_SendData(const uint8_t* Buffer, uint16_t Length)
+void Serial_SendData(const uint8_t* Buffer,
+                     uint16_t Length)
 {
        while (Length--)
          Serial_SendByte(*(Buffer++));
 }
 
 {
        while (Length--)
          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);
+}