8000 Set default for `ARDUINOJSON_ENABLE_PROGMEM` to `1` on AVR · smartcoder00/ArduinoJson@082ae69 · GitHub
[go: up one dir, main page]

Skip to content

Commit 082ae69

Browse files
committed
Set default for ARDUINOJSON_ENABLE_PROGMEM to 1 on AVR
1 parent 976a6d7 commit 082ae69

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ HEAD
66

77
* Fix compatibility with the Zephyr Project (issue #1905)
88
* Allow using PROGMEM outside of Arduino (issue #1903)
9+
* Set default for `ARDUINOJSON_ENABLE_PROGMEM` to `1` on AVR
910

1011
v6.21.1 (2023-03-27)
1112
-------

extras/conf_test/avr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <ArduinoJson.h>
22

3+
static_assert(ARDUINOJSON_ENABLE_PROGMEM == 1, "ARDUINOJSON_ENABLE_PROGMEM");
4+
35
static_assert(ARDUINOJSON_USE_LONG_LONG == 0, "ARDUINOJSON_USE_LONG_LONG");
46

57
static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 1,

src/ArduinoJson/Configuration.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@
130130
# define ARDUINOJSON_ENABLE_ARDUINO_PRINT 0
131131
# endif
132132

133-
// Disable support for PROGMEM
133+
// Enable PROGMEM support on AVR only
134134
# ifndef ARDUINOJSON_ENABLE_PROGMEM
135-
# define ARDUINOJSON_ENABLE_PROGMEM 0
135+
# ifdef __AVR__
136+
# define ARDUINOJSON_ENABLE_PROGMEM 1
137+
# else
138+
# define ARDUINOJSON_ENABLE_PROGMEM 0
139+
# endif
136140
# endif
137141

138142
#endif // ARDUINO

0 commit comments

Comments
 (0)
0