Commit afd828c0 authored by Dean Camera's avatar Dean Camera
Browse files

Removed SerialStream module, rolled functionality into the base USART Serial...

Removed SerialStream module, rolled functionality into the base USART Serial peripheral driver instead through the new Serial_CreateStream() and Serial_CreateBlockingStream() methods.

Renamed the Serial byte send/receive functions to remain consistent with the CDC driver's byte functions.

Altered the serial byte receive function to make it non-blocking.
parent 30f6d2bf
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include "EthernetProtocols.h" #include "EthernetProtocols.h"
#include "Ethernet.h" #include "Ethernet.h"
......
...@@ -104,8 +104,11 @@ void SetupHardware(void) ...@@ -104,8 +104,11 @@ void SetupHardware(void)
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();
SerialStream_Init(9600, false); Serial_Init(9600, false);
USB_Init(); USB_Init();
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
} }
/** Event handler for the library USB Connection event. */ /** Event handler for the library USB Connection event. */
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include <LUFA/Version.h> #include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h> #include <LUFA/Drivers/Peripheral/Stream.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
/* Macros: */ /* Macros: */
......
...@@ -149,8 +149,7 @@ SRC = $(TARGET).c \ ...@@ -149,8 +149,7 @@ SRC = $(TARGET).c \
Lib/Webserver.c \ Lib/Webserver.c \
$(LUFA_SRC_USB) \ $(LUFA_SRC_USB) \
$(LUFA_SRC_USBCLASS) \ $(LUFA_SRC_USBCLASS) \
$(LUFA_SRC_SERIAL) \ $(LUFA_SRC_SERIAL)
$(LUFA_SRC_SERIALSTREAM)
# List C++ source files here. (C dependencies are automatically generated.) # List C++ source files here. (C dependencies are automatically generated.)
......
...@@ -80,7 +80,10 @@ void SetupHardware(void) ...@@ -80,7 +80,10 @@ void SetupHardware(void)
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();
USB_Init(); USB_Init();
SerialStream_Init(9600, false); Serial_Init(9600, false);
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
} }
void EVENT_USB_Device_Connect(void) void EVENT_USB_Device_Connect(void)
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include <LUFA/Version.h> #include <LUFA/Version.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h> #include <LUFA/Drivers/Peripheral/Serial.h>
/* Macros: */ /* Macros: */
/** Device control request for used in the Microsoft OS Descriptor for retrieving the OS Feature /** Device control request for used in the Microsoft OS Descriptor for retrieving the OS Feature
......
...@@ -135,8 +135,7 @@ SRC = $(TARGET).c \ ...@@ -135,8 +135,7 @@ SRC = $(TARGET).c \
Lib/SideshowCommon.c \ Lib/SideshowCommon.c \
Lib/SideshowContent.c \ Lib/SideshowContent.c \
$(LUFA_SRC_USB) \ $(LUFA_SRC_USB) \
$(LUFA_SRC_SERIAL) \ $(LUFA_SRC_SERIAL)
$(LUFA_SRC_SERIALSTREAM)
# List C++ source files here. (C dependencies are automatically generated.) # List C++ source files here. (C dependencies are automatically generated.)
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <stdio.h> #include <stdio.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include "EthernetProtocols.h" #include "EthernetProtocols.h"
#include "Ethernet.h" #include "Ethernet.h"
......
...@@ -71,8 +71,11 @@ void SetupHardware(void) ...@@ -71,8 +71,11 @@ void SetupHardware(void)
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();
SerialStream_Init(9600, false); Serial_Init(9600, false);
USB_Init(); USB_Init();
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
} }
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
......
...@@ -149,8 +149,7 @@ SRC = $(TARGET).c \ ...@@ -149,8 +149,7 @@ SRC = $(TARGET).c \
Lib/Webserver.c \ Lib/Webserver.c \
Lib/RNDIS.c \ Lib/RNDIS.c \
$(LUFA_SRC_USB) \ $(LUFA_SRC_USB) \
$(LUFA_SRC_SERIAL) \ $(LUFA_SRC_SERIAL)
$(LUFA_SRC_SERIALSTREAM)
# List C++ source files here. (C dependencies are automatically generated.) # List C++ source files here. (C dependencies are automatically generated.)
......
...@@ -76,11 +76,14 @@ void SetupHardware(void) ...@@ -76,11 +76,14 @@ void SetupHardware(void)
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); Serial_Init(9600, false);
LEDs_Init(); LEDs_Init();
Joystick_Init(); Joystick_Init();
Buttons_Init(); Buttons_Init();
USB_Init(USB_MODE_UID); USB_Init(USB_MODE_UID);
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
} }
/** Event handler for the library USB mode change event. */ /** Event handler for the library USB mode change event. */
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include <LUFA/Version.h> #include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/TerminalCodes.h> #include <LUFA/Drivers/Misc/TerminalCodes.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
......
...@@ -133,8 +133,7 @@ SRC = $(TARGET).c \ ...@@ -133,8 +133,7 @@ SRC = $(TARGET).c \
HostFunctions.c \ HostFunctions.c \
$(LUFA_SRC_USB) \ $(LUFA_SRC_USB) \
$(LUFA_SRC_USBCLASS) \ $(LUFA_SRC_USBCLASS) \
$(LUFA_SRC_SERIAL) \ $(LUFA_SRC_SERIAL)
$(LUFA_SRC_SERIALSTREAM)
# List C++ source files here. (C dependencies are automatically generated.) # List C++ source files here. (C dependencies are automatically generated.)
......
...@@ -182,9 +182,12 @@ void SetupHardware(void) ...@@ -182,9 +182,12 @@ void SetupHardware(void)
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); Serial_Init(9600, false);
LEDs_Init(); LEDs_Init();
USB_Init(); USB_Init();
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
} }
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include <LUFA/Version.h> #include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/TerminalCodes.h> #include <LUFA/Drivers/Misc/TerminalCodes.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
......
...@@ -128,8 +128,7 @@ include $(LUFA_PATH)/LUFA/makefile ...@@ -128,8 +128,7 @@ include $(LUFA_PATH)/LUFA/makefile
SRC = $(TARGET).c \ SRC = $(TARGET).c \
$(LUFA_SRC_USB) \ $(LUFA_SRC_USB) \
$(LUFA_SRC_USBCLASS) \ $(LUFA_SRC_USBCLASS) \
$(LUFA_SRC_SERIAL) \ $(LUFA_SRC_SERIAL)
$(LUFA_SRC_SERIALSTREAM)
# List C++ source files here. (C dependencies are automatically generated.) # List C++ source files here. (C dependencies are automatically generated.)
......
...@@ -174,9 +174,12 @@ void SetupHardware(void) ...@@ -174,9 +174,12 @@ void SetupHardware(void)
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); Serial_Init(9600, false);
LEDs_Init(); LEDs_Init();
USB_Init(); USB_Init();
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
} }
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include <LUFA/Version.h> #include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/TerminalCodes.h> #include <LUFA/Drivers/Misc/TerminalCodes.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
......
...@@ -128,8 +128,7 @@ include $(LUFA_PATH)/LUFA/makefile ...@@ -128,8 +128,7 @@ include $(LUFA_PATH)/LUFA/makefile
SRC = $(TARGET).c \ SRC = $(TARGET).c \
$(LUFA_SRC_USB) \ $(LUFA_SRC_USB) \
$(LUFA_SRC_USBCLASS) \ $(LUFA_SRC_USBCLASS) \
$(LUFA_SRC_SERIAL) \ $(LUFA_SRC_SERIAL)
$(LUFA_SRC_SERIALSTREAM)
# List C++ source files here. (C dependencies are automatically generated.) # List C++ source files here. (C dependencies are automatically generated.)
......
...@@ -200,9 +200,12 @@ void SetupHardware(void) ...@@ -200,9 +200,12 @@ void SetupHardware(void)
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
/* Hardware Initialization */ /* Hardware Initialization */
SerialStream_Init(9600, false); Serial_Init(9600, false);
LEDs_Init(); LEDs_Init();
USB_Init(); USB_Init();
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
} }
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment