From c666b18a1219985d2909a0fa3990095a200ead64 Mon Sep 17 00:00:00 2001 From: Harald Pichler Date: Wed, 9 Nov 2016 15:14:45 +0100 Subject: [PATCH] add hardware serial1 to use with arduino api --- cpu/avr/dev/arduino/Arduino.h | 2 +- cpu/avr/dev/rs232.c | 2 +- platform/osd-merkur-128/Makefile.osd-merkur-128 | 2 ++ platform/osd-merkur-256/Makefile.osd-merkur-256 | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cpu/avr/dev/arduino/Arduino.h b/cpu/avr/dev/arduino/Arduino.h index 1da19fad7..98548a29a 100644 --- a/cpu/avr/dev/arduino/Arduino.h +++ b/cpu/avr/dev/arduino/Arduino.h @@ -145,7 +145,7 @@ extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[]; // look at this again when considering implementing serial #include "WCharacter.h" #include "WString.h" -//#include "HardwareSerial.h" +#include "HardwareSerial.h" uint16_t makeWord(uint16_t w); uint16_t makeWord(byte h, byte l); diff --git a/cpu/avr/dev/rs232.c b/cpu/avr/dev/rs232.c index 2df263491..ce4fed3c7 100644 --- a/cpu/avr/dev/rs232.c +++ b/cpu/avr/dev/rs232.c @@ -85,7 +85,7 @@ #if defined (__AVR_ATmega128__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega128RFA1__) || defined(__AVR_ATmega128RFR2__) || defined(__AVR_ATmega256RFR2__) #ifndef NUMPORTS -#define NUMPORTS 2 +#define NUMPORTS 1 // we use the second serial for arduino api HardwareSerial1.cpp #elif NUMPORTS > 2 #error Only two serial ports are defined for this processor! #endif diff --git a/platform/osd-merkur-128/Makefile.osd-merkur-128 b/platform/osd-merkur-128/Makefile.osd-merkur-128 index f2b59bb8f..797f330c3 100644 --- a/platform/osd-merkur-128/Makefile.osd-merkur-128 +++ b/platform/osd-merkur-128/Makefile.osd-merkur-128 @@ -31,6 +31,8 @@ CONTIKI_TARGET_SOURCEFILES += wiring_digital.c CONTIKI_TARGET_SOURCEFILES += new.cpp twi.c Wire.cpp WMath.cpp CONTIKI_TARGET_SOURCEFILES += Print.cpp Stream.cpp WString.cpp CONTIKI_TARGET_SOURCEFILES += SPI.cpp +CONTIKI_TARGET_SOURCEFILES += HardwareSerial.cpp HardwareSerial1.cpp + # guh Source Files # Smart Grid Ready Interface CONTIKI_TARGET_SOURCEFILES += sg-ready.c diff --git a/platform/osd-merkur-256/Makefile.osd-merkur-256 b/platform/osd-merkur-256/Makefile.osd-merkur-256 index 36828e93b..8c67fa2df 100644 --- a/platform/osd-merkur-256/Makefile.osd-merkur-256 +++ b/platform/osd-merkur-256/Makefile.osd-merkur-256 @@ -30,6 +30,7 @@ CONTIKI_TARGET_SOURCEFILES += relay.c relay-sensor.c CONTIKI_TARGET_SOURCEFILES += wiring_digital.c CONTIKI_TARGET_SOURCEFILES += new.cpp twi.c Wire.cpp WMath.cpp CONTIKI_TARGET_SOURCEFILES += Print.cpp Stream.cpp WString.cpp +CONTIKI_TARGET_SOURCEFILES += HardwareSerial.cpp HardwareSerial1.cpp # guh Source Files # Smart Grid Ready Interface CONTIKI_TARGET_SOURCEFILES += sg-ready.c