Assume PROGMEM is available as soon as ARDUINO is defined (#1693)

This commit is contained in:
Benoit Blanchon
2021-12-29 10:29:30 +01:00
parent 055304bf01
commit 67fc2d9897
10 changed files with 17 additions and 24 deletions

View File

@ -131,6 +131,11 @@
# define ARDUINOJSON_ENABLE_ARDUINO_PRINT 1
# endif
// Enable support for PROGMEM
# ifndef ARDUINOJSON_ENABLE_PROGMEM
# define ARDUINOJSON_ENABLE_PROGMEM 1
# endif
#else // ARDUINO
// Disable support for Arduino's String class
@ -148,16 +153,12 @@
# define ARDUINOJSON_ENABLE_ARDUINO_PRINT 0
# endif
#endif // ARDUINO
#ifndef ARDUINOJSON_ENABLE_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
// Disable support for PROGMEM
# ifndef ARDUINOJSON_ENABLE_PROGMEM
# define ARDUINOJSON_ENABLE_PROGMEM 0
# endif
#endif
#endif // ARDUINO
// Convert unicode escape sequence (\u0123) to UTF-8
#ifndef ARDUINOJSON_DECODE_UNICODE