diff --git a/src/protocols/Print/ITA2String.cpp b/src/protocols/Print/ITA2String.cpp index b162b259..4f2d99a7 100644 --- a/src/protocols/Print/ITA2String.cpp +++ b/src/protocols/Print/ITA2String.cpp @@ -4,7 +4,7 @@ ITA2String::ITA2String(char c) { asciiLen = 1; - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY strAscii = new char[1]; #endif strAscii[0] = c; @@ -13,7 +13,7 @@ ITA2String::ITA2String(char c) { ITA2String::ITA2String(const char* str) { asciiLen = strlen(str); - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY strAscii = new char[asciiLen + 1]; #endif strcpy(strAscii, str); @@ -21,7 +21,7 @@ ITA2String::ITA2String(const char* str) { } ITA2String::~ITA2String() { - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY delete[] strAscii; #endif } @@ -40,7 +40,7 @@ size_t ITA2String::length() { uint8_t* ITA2String::byteArr() { // create temporary array 2x the string length (figures may be 3 bytes) - #if defined(RADIOLIB_STATIC_ONLY) + #if RADIOLIB_STATIC_ONLY uint8_t temp[RADIOLIB_STATIC_ARRAY_SIZE*2 + 1]; #else uint8_t* temp = new uint8_t[asciiLen*2 + 1]; @@ -87,7 +87,7 @@ uint8_t* ITA2String::byteArr() { uint8_t* arr = new uint8_t[arrayLen]; memcpy(arr, temp, arrayLen); - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY delete[] temp; #endif diff --git a/src/protocols/Print/ITA2String.h b/src/protocols/Print/ITA2String.h index 556c0a3b..579bb1c4 100644 --- a/src/protocols/Print/ITA2String.h +++ b/src/protocols/Print/ITA2String.h @@ -53,10 +53,10 @@ class ITA2String { */ uint8_t* byteArr(); -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE private: #endif - #if defined(RADIOLIB_STATIC_ONLY) + #if RADIOLIB_STATIC_ONLY char strAscii[RADIOLIB_STATIC_ARRAY_SIZE]; #else char* strAscii; diff --git a/src/protocols/Print/Print.cpp b/src/protocols/Print/Print.cpp index f944ec75..94b7b334 100644 --- a/src/protocols/Print/Print.cpp +++ b/src/protocols/Print/Print.cpp @@ -42,7 +42,7 @@ size_t RadioLibPrint::print(const __FlashStringHelper* fstr) { } // dynamically allocate memory - #if defined(RADIOLIB_STATIC_ONLY) + #if RADIOLIB_STATIC_ONLY char str[RADIOLIB_STATIC_ARRAY_SIZE]; #else char* str = new char[len]; @@ -61,7 +61,7 @@ size_t RadioLibPrint::print(const __FlashStringHelper* fstr) { } else { n = write((uint8_t*)str, len); } - #if !defined(RADIOLIB_STATIC_ONLY) + #if !RADIOLIB_STATIC_ONLY delete[] str; #endif return(n); diff --git a/src/protocols/Print/Print.h b/src/protocols/Print/Print.h index a132cf61..48bd7e70 100644 --- a/src/protocols/Print/Print.h +++ b/src/protocols/Print/Print.h @@ -53,7 +53,7 @@ class RadioLibPrint { size_t println(double, int = 2); size_t println(void); -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE protected: #endif uint8_t encoding = RADIOLIB_ASCII_EXTENDED;