diff --git a/avrpins.h b/avrpins.h index b1c75238..ec4ae672 100644 --- a/avrpins.h +++ b/avrpins.h @@ -1328,8 +1328,6 @@ MAKE_PIN(P13, 13); // #elif defined(ESP8266) || defined(ESP32) -#define pgm_read_pointer(p) pgm_read_ptr(p) - #define MAKE_PIN(className, pin) \ class className { \ public: \ @@ -1418,6 +1416,12 @@ MAKE_PIN(P17, 17); // INT #undef MAKE_PIN +// pgm_read_ptr is not defined in the ESP32, so we have to undef the diffinition from version_helper.h +#ifdef pgm_read_pointer +#undef pgm_read_pointer +#endif +#define pgm_read_pointer(p) pgm_read_ptr(p) + #else #error "Please define board in avrpins.h"