Skip to content

Commit

Permalink
Fixed error "no matching function for pgm_read<double>()" on AVR
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon committed Oct 17, 2020
1 parent 7120052 commit 41132b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ArduinoJson/Polyfills/pgmspace_generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ typename enable_if<is_pointer<T>::value, T>::type pgm_read(const void* p) {
}

template <typename T>
typename enable_if<is_same<T, float>::value, T>::type pgm_read(const void* p) {
typename enable_if<is_floating_point<T>::value &&
sizeof(T) == sizeof(float), // on AVR sizeof(double) ==
// sizeof(float)
T>::type
pgm_read(const void* p) {
return pgm_read_float(p);
}

Expand Down

0 comments on commit 41132b7

Please sign in to comment.