Added software serial platform macro
This commit is contained in:
parent
c093d34c91
commit
11b501cbc9
2 changed files with 6 additions and 3 deletions
|
@ -7,8 +7,8 @@ Module::Module(int rx, int tx, HardwareSerial* useSer) {
|
||||||
_int0 = -1;
|
_int0 = -1;
|
||||||
_int1 = -1;
|
_int1 = -1;
|
||||||
|
|
||||||
#if defined(ESP32) || defined(SAMD_SERIES) || defined (ARDUINO_ARCH_STM32)
|
#if SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
ModuleSerial = useSer;
|
ModuleSerial = useSer;
|
||||||
#else
|
#else
|
||||||
ModuleSerial = new SoftwareSerial(_rx, _tx);
|
ModuleSerial = new SoftwareSerial(_rx, _tx);
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,7 +33,7 @@ Module::Module(int cs, int int0, int int1, int rx, int tx, SPIClass& spi, SPISet
|
||||||
_spi = &spi;
|
_spi = &spi;
|
||||||
_spiSettings = spiSettings;
|
_spiSettings = spiSettings;
|
||||||
|
|
||||||
#if defined(ESP32) || defined(SAMD_SERIES) || defined (ARDUINO_ARCH_STM32)
|
#if SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
ModuleSerial = useSer;
|
ModuleSerial = useSer;
|
||||||
#else
|
#else
|
||||||
ModuleSerial = new SoftwareSerial(_rx, _tx);
|
ModuleSerial = new SoftwareSerial(_rx, _tx);
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
#error "Unsupported Arduino version (< 1.0.0)"
|
#error "Unsupported Arduino version (< 1.0.0)"
|
||||||
#endif
|
#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_PORT Serial
|
||||||
|
|
||||||
//#define RADIOLIB_DEBUG
|
//#define RADIOLIB_DEBUG
|
||||||
|
|
Loading…
Add table
Reference in a new issue