Skip to content

Commit 9ec03ed

Browse files
Move WiFi debug messages to PMEM (#5388)
Save ~1200 bytes in debug mode by making debug strings into PSTRs().
1 parent 2486405 commit 9ec03ed

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern "C" {
4545

4646
#ifdef DEBUG_ESP_WIFI
4747
#ifdef DEBUG_ESP_PORT
48-
#define DEBUG_WIFI(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )
48+
#define DEBUG_WIFI(fmt, ...) DEBUG_ESP_PORT.printf_P( (PGM_P)PSTR(fmt), ##__VA_ARGS__ )
4949
#endif
5050
#endif
5151

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#ifdef DEBUG_ESP_WIFI
3131
#ifdef DEBUG_ESP_PORT
32-
#define DEBUG_WIFI_GENERIC(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )
32+
#define DEBUG_WIFI_GENERIC(fmt, ...) DEBUG_ESP_PORT.printf( (PGM_P)PSTR(fmt), ##__VA_ARGS__ )
3333
#endif
3434
#endif
3535

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiMulti.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#ifdef DEBUG_ESP_WIFI
3434
#ifdef DEBUG_ESP_PORT
35-
#define DEBUG_WIFI_MULTI(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )
35+
#define DEBUG_WIFI_MULTI(fmt, ...) DEBUG_ESP_PORT.printf( (PGM_P)PSTR(fmt), ##__VA_ARGS__ )
3636
#endif
3737
#endif
3838

0 commit comments

Comments
 (0)