From d483f8fa0c7c1f65c926b24d6c66275953d03c4f Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Fri, 1 Jun 2012 01:10:47 -0400 Subject: Bring back HardwareSerial. To make this happen, we need to have tell us whether or not it's got each of the USARTs. Do that with BOARD_HAVE_USARTn, for n = 1,...,6. This lets us define HardwareSerial instances only when appropriate, and gets rid of some board-specific hacks we'd accumulated. The new now has a convenience function for determining the bus rate by using the appropriate STM32_PCLKx macro, so we can shave a uint32 per instance, which is nice given that they're all going to be in memory. This changes the constructor arguments, but the API only specifies the semantics of the predefined instances, so this is still backwards-compatible. (We should look into storing the instances in Flash -- they don't change, after all.) We don't actually need struct usart_dev's definition in HardwareSerial.h, so replace it with a forward declaration and include it in HardwareSerial.cpp instead. Assert some copyrights. Signed-off-by: Marti Bolivar --- wirish/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wirish/rules.mk') diff --git a/wirish/rules.mk b/wirish/rules.mk index 903c817..4084448 100644 --- a/wirish/rules.mk +++ b/wirish/rules.mk @@ -22,6 +22,7 @@ sSRCS_$(d) := start.S cSRCS_$(d) := start_c.c cppSRCS_$(d) := boards.cpp cppSRCS_$(d) += cxxabi-compat.cpp +cppSRCS_$(d) += HardwareSerial.cpp cppSRCS_$(d) += Print.cpp cppSRCS_$(d) += wirish_digital.cpp cppSRCS_$(d) += wirish_math.cpp @@ -31,7 +32,6 @@ cppSRCS_$(d) += $(MCU_SERIES)/boards_setup.cpp cppSRCS_$(d) += $(MCU_SERIES)/wirish_digital.cpp cppSRCS_$(d) += $(WIRISH_BOARD_PATH)/board.cpp # TODO: revise these appropriately F2 and put them back in: -# HardwareSerial.cpp # HardwareSPI.cpp # HardwareTimer.cpp # usb_serial.cpp -- cgit v1.2.3