diff --git a/src/main.cpp b/src/main.cpp index 090bcb9a7..104731ef3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -367,7 +367,7 @@ void setup() } #endif -#if defined(USE_SX1281) +#if defined(USE_SX1281) && !defined(ARCH_PORTDUINO) if (!rIf) { rIf = new SX1281Interface(SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY, SPI); if (!rIf->init()) { diff --git a/src/mesh/SX1281Interface.cpp b/src/mesh/SX1281Interface.cpp index 16ac473c5..50805cfe0 100644 --- a/src/mesh/SX1281Interface.cpp +++ b/src/mesh/SX1281Interface.cpp @@ -2,8 +2,12 @@ #include "SX1281Interface.h" #include "error.h" +#if !defined(ARCH_PORTDUINO) + SX1281Interface::SX1281Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi) : SX128xInterface(cs, irq, rst, busy, spi) { -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/src/mesh/SX1281Interface.h b/src/mesh/SX1281Interface.h index e7a080bc8..3bd65309a 100644 --- a/src/mesh/SX1281Interface.h +++ b/src/mesh/SX1281Interface.h @@ -5,8 +5,13 @@ /** * Our adapter for SX1281 radios */ + +#if !defined(ARCH_PORTDUINO) + class SX1281Interface : public SX128xInterface { public: SX1281Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi); -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index d01f83ab9..10d791847 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -2,6 +2,8 @@ #include "SX128xInterface.h" #include "error.h" +#if !defined(ARCH_PORTDUINO) + // Particular boards might define a different max power based on what their hardware can do #ifndef SX128X_MAX_POWER #define SX128X_MAX_POWER 22 @@ -241,3 +243,5 @@ bool SX128xInterface::sleep() return true; } + +#endif \ No newline at end of file diff --git a/src/mesh/SX128xInterface.h b/src/mesh/SX128xInterface.h index 24ed73cbf..d01dfc510 100644 --- a/src/mesh/SX128xInterface.h +++ b/src/mesh/SX128xInterface.h @@ -1,5 +1,7 @@ #pragma once +#if !defined(ARCH_PORTDUINO) + #include "RadioLibInterface.h" /** @@ -69,3 +71,5 @@ class SX128xInterface : public RadioLibInterface private: }; + +#endif \ No newline at end of file