forked from bblanchon/ArduinoJson
Fix conflicting definition of ARDUINOJSON_DEFINE_STATIC_ARRAY()
This commit is contained in:
@ -35,7 +35,7 @@ inline uint32_t pgm_read_dword(const void* p) {
|
|||||||
return *reinterpret_cast<const uint32_t*>(convertFlashToPtr(p));
|
return *reinterpret_cast<const uint32_t*>(convertFlashToPtr(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ARDUINOJSON_DEFINE_STATIC_ARRAY(type, name, value) \
|
#define ARDUINOJSON_DEFINE_PROGMEM_ARRAY(type, name, value) \
|
||||||
static type const ARDUINOJSON_CONCAT2(name, _progmem)[] = value; \
|
static type const ARDUINOJSON_CONCAT2(name, _progmem)[] = value; \
|
||||||
static type const* name = reinterpret_cast<type const*>( \
|
static type const* name = reinterpret_cast<type const*>( \
|
||||||
convertPtrToFlash(ARDUINOJSON_CONCAT2(name, _progmem)));
|
convertPtrToFlash(ARDUINOJSON_CONCAT2(name, _progmem)));
|
||||||
|
@ -10,25 +10,21 @@
|
|||||||
|
|
||||||
# include <ArduinoJson/Polyfills/pgmspace_generic.hpp>
|
# include <ArduinoJson/Polyfills/pgmspace_generic.hpp>
|
||||||
|
|
||||||
# ifndef ARDUINOJSON_DEFINE_STATIC_ARRAY
|
# ifndef ARDUINOJSON_DEFINE_PROGMEM_ARRAY
|
||||||
# define ARDUINOJSON_DEFINE_STATIC_ARRAY(type, name, value) \
|
# define ARDUINOJSON_DEFINE_PROGMEM_ARRAY(type, name, value) \
|
||||||
static type const name[] PROGMEM = value;
|
static type const name[] PROGMEM = value;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifndef ARDUINOJSON_READ_STATIC_ARRAY
|
# define ARDUINOJSON_DEFINE_STATIC_ARRAY ARDUINOJSON_DEFINE_PROGMEM_ARRAY
|
||||||
# define ARDUINOJSON_READ_STATIC_ARRAY(type, name, index) \
|
|
||||||
pgm_read<type>(name + index)
|
# define ARDUINOJSON_READ_STATIC_ARRAY(type, name, index) \
|
||||||
# endif
|
pgm_read<type>(name + index)
|
||||||
|
|
||||||
#else // i.e. ARDUINOJSON_ENABLE_PROGMEM == 0
|
#else // i.e. ARDUINOJSON_ENABLE_PROGMEM == 0
|
||||||
|
|
||||||
# ifndef ARDUINOJSON_DEFINE_STATIC_ARRAY
|
# define ARDUINOJSON_DEFINE_STATIC_ARRAY(type, name, value) \
|
||||||
# define ARDUINOJSON_DEFINE_STATIC_ARRAY(type, name, value) \
|
static type const name[] = value;
|
||||||
static type const name[] = value;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifndef ARDUINOJSON_READ_STATIC_ARRAY
|
# define ARDUINOJSON_READ_STATIC_ARRAY(type, name, index) name[index]
|
||||||
# define ARDUINOJSON_READ_STATIC_ARRAY(type, name, index) name[index]
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user