From 16e51b83abfcd9c89968641e97660121f7b2936d Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Tue, 10 Nov 2020 14:58:31 +0100 Subject: [PATCH] Changed the default value of ARDUINOJSON_ENABLE_PROGMEM (fixes #1433) It now checks that the pgm_read_XXX macros are defined before enabling PROGMEM. --- CHANGELOG.md | 2 ++ src/ArduinoJson/Configuration.hpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31b21688..e786528b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ HEAD ---- * Fixed invalid conversion error in `operator|(JsonVariant, char*)` (issue #1432) +* Changed the default value of `ARDUINOJSON_ENABLE_PROGMEM` (issue #1433). + It now checks that the `pgm_read_XXX` macros are defined before enabling `PROGMEM`. v6.17.1 (2020-11-07) ------- diff --git a/src/ArduinoJson/Configuration.hpp b/src/ArduinoJson/Configuration.hpp index 32a6f339..53021201 100644 --- a/src/ArduinoJson/Configuration.hpp +++ b/src/ArduinoJson/Configuration.hpp @@ -172,7 +172,8 @@ #endif // ARDUINO #ifndef ARDUINOJSON_ENABLE_PROGMEM -#ifdef PROGMEM +#if defined(PROGMEM) && defined(pgm_read_byte) && defined(pgm_read_dword) && \ + defined(pgm_read_ptr) && defined(pgm_read_float) #define ARDUINOJSON_ENABLE_PROGMEM 1 #else #define ARDUINOJSON_ENABLE_PROGMEM 0