From ca7436315ac9e742beddb8d95df62b7bbef6d34f Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 21 Aug 2015 16:56:06 +0200 Subject: wip --- Debug.h | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'Debug.h') diff --git a/Debug.h b/Debug.h index 4883083..9bf82bf 100644 --- a/Debug.h +++ b/Debug.h @@ -3,15 +3,9 @@ #include "config-check.h" -template -struct conditional { typedef T type; }; +#include -template -struct conditional { typedef F type; }; - -#include - -#ifdef __AVR_ATtiny85__ +#ifdef ARDUINO_attiny class Serial { public: void begin(int); @@ -33,27 +27,14 @@ enum DebugSink { DEBUG_SINK_SOFTWARE_SERIAL, }; -struct DebugEmptyBase {}; -struct DebugSoftwareSerialBase { - // TODO: these should be customizable - static const int rx_pin = 1; - static const int tx_pin = 0; - -public: - SoftwareSerial ss; - - DebugSoftwareSerialBase() : ss(rx_pin, tx_pin) { - } -}; - -template -class Debug : public conditional::type +template +class Debug { - + AltSoftSerial ss; public: const enum DebugSink sink; - Debug() : sink(sink_) { + Debug() : ss(rx_pin, tx_pin), sink(sink_) { } inline void begin(const long baud_rate) { -- cgit v1.2.3