Fixed pgm_read_ptr_aligned macro for the ESP8266 platform

See: https://github.com/esp8266/Arduino/pull/5735
This commit is contained in:
Kristian Sloth Lauszus 2019-04-14 23:21:28 +02:00
parent 0ecc486fee
commit b3fa5718d5

View file

@ -157,6 +157,16 @@ e-mail : support@circuitsathome.com
#define fprintf_P(s, ...) ((s), __VA_ARGS__)
#endif
#ifdef ESP8266
// Workaround the following issue: https://github.com/esp8266/Arduino/pull/5735
#undef pgm_read_ptr_aligned
#ifdef __cplusplus
#define pgm_read_ptr_aligned(addr) (*reinterpret_cast<const void* const*>(addr))
#else
#define pgm_read_ptr_aligned(addr) (*(const void* const*)(addr))
#endif
#endif
#ifndef pgm_read_byte
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#endif