ESP32Encoder
ESP32Encoder copied to clipboard
fix compiling with ESP-IDF 5.x,
see https://github.com/madhephaestus/ESP32Encoder/issues/101
can you add the compiler gaurds so this is only added these imports on the older cores? Or have you tested this works in 1.04 and 2.x.x before we merge this?
I've tested with Arduino 2.0.14 & 3.0 but not with Arduino 1. For safety i've added a compiler define..
An alternative condition would be
#if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 3) )
but i'm happy with
#if ESP_IDF_VERSION_MAJOR == 5
I would prefer the #if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 3) ) to be backwards compatible and future looking as the major number is increased over time.
this is released as of 0.11.2
Sorry for the inconvenience: With changed directive it does not compile with Arduino 3 / ESP-IDF 5.
We need additionally
#include <Arduino.h>
or change the compiler condition to
#if ESP_IDF_VERSION_MAJOR >= 5
@madhephaestus What solution do you prefer?