From 8ca3c3cc9de682ccdbf3353a7dfc7ea55840d6ee Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 5 Aug 2017 22:28:38 -0700 Subject: [PATCH] Move debug constant strings to PROGMEM 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 3c8c95050a..9a06332c39 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