diff --git a/src/ArduinoJson/Polyfills/pgmspace_generic.hpp b/src/ArduinoJson/Polyfills/pgmspace_generic.hpp index 70f715fd3..c6c1847e6 100644 --- a/src/ArduinoJson/Polyfills/pgmspace_generic.hpp +++ b/src/ArduinoJson/Polyfills/pgmspace_generic.hpp @@ -15,7 +15,11 @@ typename enable_if::value, T>::type pgm_read(const void* p) { } template -typename enable_if::value, T>::type pgm_read(const void* p) { +typename enable_if::value && + sizeof(T) == sizeof(float), // on AVR sizeof(double) == + // sizeof(float) + T>::type +pgm_read(const void* p) { return pgm_read_float(p); }