From 63287ab6fda74435fd7ee19122c8739acef1711a Mon Sep 17 00:00:00 2001 From: jgromes Date: Mon, 27 Nov 2023 19:40:00 +0100 Subject: [PATCH] [nRF24] Reworked macro configuration system --- src/modules/nRF24/nRF24.cpp | 6 +++--- src/modules/nRF24/nRF24.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/nRF24/nRF24.cpp b/src/modules/nRF24/nRF24.cpp index c48b5b17..e4923bcd 100644 --- a/src/modules/nRF24/nRF24.cpp +++ b/src/modules/nRF24/nRF24.cpp @@ -1,6 +1,6 @@ #include "nRF24.h" #include -#if !defined(RADIOLIB_EXCLUDE_NRF24) +#if !RADIOLIB_EXCLUDE_NRF24 nRF24::nRF24(Module* mod) : PhysicalLayer(RADIOLIB_NRF24_FREQUENCY_STEP_SIZE, RADIOLIB_NRF24_MAX_PACKET_LENGTH) { this->mod = mod; @@ -617,7 +617,7 @@ void nRF24::SPIwriteTxPayload(uint8_t* data, uint8_t numBytes) { void nRF24::SPItransfer(uint8_t cmd, bool write, uint8_t* dataOut, uint8_t* dataIn, uint8_t numBytes) { // prepare the buffers size_t buffLen = 1 + numBytes; - #if defined(RADIOLIB_STATIC_ONLY) + #if RADIOLIB_STATIC_ONLY uint8_t buffOut[RADIOLIB_STATIC_ARRAY_SIZE]; uint8_t buffIn[RADIOLIB_STATIC_ARRAY_SIZE]; #else @@ -648,7 +648,7 @@ void nRF24::SPItransfer(uint8_t cmd, bool write, uint8_t* dataOut, uint8_t* data memcpy(dataIn, &buffIn[1], numBytes); } - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY delete[] buffOut; delete[] buffIn; #endif diff --git a/src/modules/nRF24/nRF24.h b/src/modules/nRF24/nRF24.h index 5a59877f..d6f9346a 100644 --- a/src/modules/nRF24/nRF24.h +++ b/src/modules/nRF24/nRF24.h @@ -1,4 +1,4 @@ -#if !defined(_RADIOLIB_NRF24_H) && !defined(RADIOLIB_EXCLUDE_NRF24) +#if !defined(_RADIOLIB_NRF24_H) && !RADIOLIB_EXCLUDE_NRF24 #define _RADIOLIB_NRF24_H #include "../../Module.h" @@ -467,7 +467,7 @@ class nRF24: public PhysicalLayer { */ int16_t setEncoding(uint8_t encoding) override; -#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL) +#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL protected: #endif Module* mod; @@ -476,7 +476,7 @@ class nRF24: public PhysicalLayer { void SPIwriteTxPayload(uint8_t* data, uint8_t numBytes); void SPItransfer(uint8_t cmd, bool write = false, uint8_t* dataOut = NULL, uint8_t* dataIn = NULL, uint8_t numBytes = 0); -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE protected: #endif