From 1132488e8f80b43473ce4e53db9dd8ce12e87e13 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 18 Feb 2012 23:33:12 +0000 Subject: Add build tests to verify correct compilation of as many modules as possible under as many architectures as possible. Fix broken compilation of LUFA under C++ compilers when the Serial peripheral module header file is included in a C++ source file. Fix missing semicolon in the UC3 architecture host pipe functions. Fix failed compilation for the XMEGA architecture if USB_DEVICE_ONLY us not specified. --- LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c') diff --git a/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c b/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c index 4c2f1ae31..f391c06e0 100644 --- a/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c +++ b/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c @@ -89,3 +89,26 @@ void Serial_SendData(const uint8_t* 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); +} -- cgit v1.2.3