From 4bed115abd00163f1ff370f2caef3d51dfb3c9ae Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Mon, 7 Aug 2017 05:43:28 -0700 Subject: [PATCH] Move debug constant strings to PROGMEM (#3478) UMM debugging strings are normally placed in RODATA, which uses up scarse memory. Move them to PROGMEM and use macros to replace printf with a version that can handle ROM strings. --- cores/esp8266/umm_malloc/umm_malloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cores/esp8266/umm_malloc/umm_malloc.c b/cores/esp8266/umm_malloc/umm_malloc.c index 3c8c95050..9a06332c3 100644 --- a/cores/esp8266/umm_malloc/umm_malloc.c +++ b/cores/esp8266/umm_malloc/umm_malloc.c @@ -493,6 +493,7 @@ #include #include +#include #include "umm_malloc.h" @@ -512,6 +513,9 @@ # define DBG_LOG_LEVEL DBG_LOG_LEVEL #endif +// Macro to place constant strings into PROGMEM and print them properly +#define printf(fmt, ...) do { static const char fstr[] PROGMEM = fmt; char rstr[sizeof(fmt)]; for (size_t i=0; i