Added software serial platform macro

pull/64/head
jgromes 2019-09-28 10:39:20 +02:00
rodzic c093d34c91
commit 11b501cbc9
2 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -7,8 +7,8 @@ Module::Module(int rx, int tx, HardwareSerial* useSer) {
_int0 = -1;
_int1 = -1;
#if defined(ESP32) || defined(SAMD_SERIES) || defined (ARDUINO_ARCH_STM32)
ModuleSerial = useSer;
#if SOFTWARE_SERIAL_UNSUPPORTED
ModuleSerial = useSer;
#else
ModuleSerial = new SoftwareSerial(_rx, _tx);
#endif
@ -33,7 +33,7 @@ Module::Module(int cs, int int0, int int1, int rx, int tx, SPIClass& spi, SPISet
_spi = &spi;
_spiSettings = spiSettings;
#if defined(ESP32) || defined(SAMD_SERIES) || defined (ARDUINO_ARCH_STM32)
#if SOFTWARE_SERIAL_UNSUPPORTED
ModuleSerial = useSer;
#else
ModuleSerial = new SoftwareSerial(_rx, _tx);

Wyświetl plik

@ -7,6 +7,9 @@
#error "Unsupported Arduino version (< 1.0.0)"
#endif
// the following platforms do not support SoftwareSerial library
#define SOFTWARE_SERIAL_UNSUPPORTED (defined(ESP32) || defined(SAMD_SERIES) || defined (ARDUINO_ARCH_STM32))
#define RADIOLIB_DEBUG_PORT Serial
//#define RADIOLIB_DEBUG