diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index f6ae93b406..307d16fead 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -32,7 +32,7 @@ void LockingArduinoHal::spiEndTransaction() spiLock->unlock(); } -#if RADIO_SPI_BULK_ACTIVE +#if RADIO_SPI_BULK void LockingArduinoHal::spiTransfer(uint8_t *out, size_t len, uint8_t *in) { #if defined(ARDUINO_ARCH_ESP32) @@ -49,7 +49,7 @@ RadioLibInterface::RadioLibInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE c { instance = this; -#if RADIO_SPI_BULK && RADIO_SPI_BULK_ACTIVE && !ARCH_PORTDUINO +#if RADIO_SPI_BULK && !ARCH_PORTDUINO LOG_INFO("RADIO_SPI_BULK: one SPI transfer per radio command"); #endif diff --git a/src/mesh/RadioLibInterface.h b/src/mesh/RadioLibInterface.h index 1073bfa4be..e198a354ea 100644 --- a/src/mesh/RadioLibInterface.h +++ b/src/mesh/RadioLibInterface.h @@ -36,15 +36,18 @@ #define AGC_FORCED_RESET_MS (24 * 60 * 60 * 1000UL) #endif -// 1 = move each radio command as one buffered SPI transfer on nRF52 and ESP32, as Portduino already does, instead of -// RadioLib's one SPI.transfer() call per byte. Off by default pending wider soak. +// 1 = send each radio command as one buffered SPI transfer, instead of RadioLib's one +// SPI.transfer() call per byte. Portduino has always done this; nRF52 and ESP32 can opt in, and no +// other architecture has a buffered call to use. Off by default there pending a wider soak. #ifndef RADIO_SPI_BULK +#if ARCH_PORTDUINO +#define RADIO_SPI_BULK 1 +#else #define RADIO_SPI_BULK 0 #endif -#if ARCH_PORTDUINO || (RADIO_SPI_BULK && (defined(ARDUINO_NRF52_ADAFRUIT) || defined(ARDUINO_ARCH_ESP32))) -#define RADIO_SPI_BULK_ACTIVE 1 -#else -#define RADIO_SPI_BULK_ACTIVE 0 +#endif +#if RADIO_SPI_BULK && !(ARCH_PORTDUINO || defined(ARDUINO_NRF52_ADAFRUIT) || defined(ARDUINO_ARCH_ESP32)) +#error "RADIO_SPI_BULK: no buffered SPI call on this architecture" #endif /** @@ -57,7 +60,7 @@ class LockingArduinoHal : public ArduinoHal void spiBeginTransaction() override; void spiEndTransaction() override; -#if RADIO_SPI_BULK_ACTIVE +#if RADIO_SPI_BULK void spiTransfer(uint8_t *out, size_t len, uint8_t *in) override; #endif