diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.cpp b/src/protocols/PhysicalLayer/PhysicalLayer.cpp index 0bb634f9..8b999325 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.cpp +++ b/src/protocols/PhysicalLayer/PhysicalLayer.cpp @@ -4,7 +4,7 @@ PhysicalLayer::PhysicalLayer(float step, size_t maxLen) { this->freqStep = step; this->maxPacketLength = maxLen; - #if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) + #if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE this->bufferBitPos = 0; this->bufferWritePos = 0; #endif @@ -24,7 +24,7 @@ int16_t PhysicalLayer::transmit(__FlashStringHelper* fstr, uint8_t addr) { } // dynamically allocate memory - #if defined(RADIOLIB_STATIC_ONLY) + #if RADIOLIB_STATIC_ONLY char str[RADIOLIB_STATIC_ARRAY_SIZE]; #else char* str = new char[len]; @@ -38,7 +38,7 @@ int16_t PhysicalLayer::transmit(__FlashStringHelper* fstr, uint8_t addr) { // transmit string int16_t state = transmit(str, addr); - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY delete[] str; #endif return(state); @@ -68,7 +68,7 @@ int16_t PhysicalLayer::receive(String& str, size_t len) { size_t length = len; // build a temporary buffer - #if defined(RADIOLIB_STATIC_ONLY) + #if RADIOLIB_STATIC_ONLY uint8_t data[RADIOLIB_STATIC_ARRAY_SIZE + 1]; #else uint8_t* data = NULL; @@ -101,7 +101,7 @@ int16_t PhysicalLayer::receive(String& str, size_t len) { } // deallocate temporary buffer - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY delete[] data; #endif @@ -175,7 +175,7 @@ int16_t PhysicalLayer::readData(String& str, size_t len) { } // build a temporary buffer - #if defined(RADIOLIB_STATIC_ONLY) + #if RADIOLIB_STATIC_ONLY uint8_t data[RADIOLIB_STATIC_ARRAY_SIZE + 1]; #else uint8_t* data = new uint8_t[length + 1]; @@ -198,7 +198,7 @@ int16_t PhysicalLayer::readData(String& str, size_t len) { } // deallocate temporary buffer - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY delete[] data; #endif @@ -366,7 +366,7 @@ int16_t PhysicalLayer::startDirect() { return(state); } -#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) +#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE int16_t PhysicalLayer::available() { return(this->bufferWritePos); } @@ -477,7 +477,7 @@ void PhysicalLayer::clearChannelScanAction() { } -#if defined(RADIOLIB_INTERRUPT_TIMING) +#if RADIOLIB_INTERRUPT_TIMING void PhysicalLayer::setInterruptSetup(void (*func)(uint32_t)) { Module* mod = getMod(); mod->TimerSetupCb = func; diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.h b/src/protocols/PhysicalLayer/PhysicalLayer.h index 741cdb8c..513a3e1d 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.h +++ b/src/protocols/PhysicalLayer/PhysicalLayer.h @@ -380,7 +380,7 @@ class PhysicalLayer { */ int16_t startDirect(); - #if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) + #if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE /*! \brief Set sync word to be used to determine start of packet in direct reception mode. \param syncWord Sync word bits. @@ -463,7 +463,7 @@ class PhysicalLayer { */ virtual void clearChannelScanAction(); - #if defined(RADIOLIB_INTERRUPT_TIMING) + #if RADIOLIB_INTERRUPT_TIMING /*! \brief Set function to be called to set up the timing interrupt. @@ -480,18 +480,18 @@ class PhysicalLayer { #endif -#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) +#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE protected: void updateDirectBuffer(uint8_t bit); #endif -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE private: #endif float freqStep; size_t maxPacketLength; - #if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) + #if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE uint8_t bufferBitPos; uint8_t bufferWritePos; uint8_t bufferReadPos;