iotappstory / ESP-Library

Software Distribution and Management Over the Air
GNU Lesser General Public License v2.1
124 stars 35 forks source link

debug level 0 lead to compilation error #192

Open antonmeyer opened 2 years ago

antonmeyer commented 2 years ago

several macros are not defined if you set debug level to 0, and that leads to compilation errors where the macros are still used

so I added at this places "&& DEBUG_LVL >= 1 " like

if DEBUG_FREE_HEAP == true && DEBUG_LVL >= 1

if DEBUG_LVL >= 1

// set to true to include code for show EEPROM contents in debug
#ifndef DEBUG_EEPROM_CONFIG
    #define DEBUG_EEPROM_CONFIG false
#endif

// macros for debugging
#ifdef DEBUG_PORT
    #define DEBUG_MSG(...) DEBUG_PORT.printf( __VA_ARGS__ )
#else
    #define DEBUG_MSG(...)
#endif

#define         DEBUG_PRINT(x)    { Serial.print(x);   }
#define         DEBUG_PRINTF(...) { Serial.printf(__VA_ARGS__);  }
#define         DEBUG_PRINTF_P(...) { Serial.printf_P(__VA_ARGS__);  }
#define         DEBUG_PRINTLN(x)  { Serial.println(x); }

endif