Skip to content

Commit dbd0126

Browse files
committed
version string honours NDEBUG
1 parent dae3932 commit dbd0126

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

cores/esp8266/Esp.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,15 @@ String EspClass::getSketchMD5()
557557
return result;
558558
}
559559

560+
#ifdef NDEBUG
561+
562+
String EspClass::getFullVersion()
563+
{
564+
return String();
565+
}
566+
567+
#else // !NDEBUG
568+
560569
static const char arduino_esp8266_git_ver [] PROGMEM = STR(ARDUINO_ESP8266_GIT_VER);
561570
#if LWIP_VERSION_MAJOR != 1
562571
static const char lwip2_version [] PROGMEM = "/lwIP:" STR(LWIP_VERSION_MAJOR) "." STR(LWIP_VERSION_MINOR) "." STR(LWIP_VERSION_REVISION);
@@ -583,3 +592,5 @@ String EspClass::getFullVersion()
583592
#endif
584593
;
585594
}
595+
596+
#endif // !NDEBUG

cores/esp8266/HardwareSerial.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void HardwareSerial::begin(unsigned long baud, SerialConfig config, SerialMode m
3939
{
4040
end();
4141
_uart = uart_init(_uart_nr, baud, (int) config, (int) mode, tx_pin, _rx_size);
42-
#ifdef DEBUG_ESP_PORT
42+
#if defined(DEBUG_ESP_PORT) && !defined(NDEBUG)
4343
println(ESP.getFullVersion());
4444
#endif
4545
}
@@ -97,7 +97,7 @@ void HardwareSerial::setDebugOutput(bool en)
9797
if(en) {
9898
if(uart_tx_enabled(_uart)) {
9999
uart_set_debug(_uart_nr);
100-
#ifndef DEBUG_ESP_PORT
100+
#if !defined(DEBUG_ESP_PORT) && !defined(NDEBUG)
101101
os_printf("%s\r\n", ESP.getFullVersion().c_str());
102102
#endif
103103
} else {

0 commit comments

Comments
 (0)