From 87fdaaabd62268936615321bc14679b3e59e286e Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 10 Aug 2015 19:30:14 +0200 Subject: o Implementing the SoftwareSerial version of debugging. --- trygvisio_soil_moisture.ino | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'trygvisio_soil_moisture.ino') diff --git a/trygvisio_soil_moisture.ino b/trygvisio_soil_moisture.ino index bb55b70..25baac0 100644 --- a/trygvisio_soil_moisture.ino +++ b/trygvisio_soil_moisture.ino @@ -7,6 +7,7 @@ #ifdef PERSISTENT_CONFIGURATION_SUPPORT #include #endif +#include #include #include #include @@ -83,6 +84,7 @@ void __ble_assert(const char *file, uint16_t line) static void go_to_sleep(); +extern SoftwareSerial ss; void setup() { #ifdef TXLED0 // An attempt to make sure that the RX and TX LEDs are turned off when running normally. @@ -100,7 +102,15 @@ void setup() { CLKPR = 0; #endif - debug.begin(115200); + if (debug.sink == DEBUG_SINK_SERIAL) { + debug.begin(115200); + } else if (debug.sink == DEBUG_SINK_SOFTWARE_SERIAL) { + debug.begin(9600); + + while(true) { + debug.println("hello debug world!"); + } + } #if WAIT_FOR_SERIAL_BEFORE_STARING // Wait until the serial port is available (useful only for the Leonardo) @@ -153,8 +163,8 @@ static void setup_rf() { aci_state.aci_pins.interface_is_interrupt = false; aci_state.aci_pins.interrupt_number = 4; -#error wat -#elif ARDUINO_AVR_LEONARDO // Assumes OLIMEXINO-32U4 and UEXT +#elif ARDUINO_AVR_LEONARDO + // Assumes OLIMEXINO-32U4 and UEXT aci_state.aci_pins.board_name = BOARD_DEFAULT; aci_state.aci_pins.reqn_pin = 2; aci_state.aci_pins.rdyn_pin = 13; -- cgit v1.2.3