Add legacy ESP32 compatibility fixes
This commit is contained in:
14
include/ArduinoEsp32Compat.h
Normal file
14
include/ArduinoEsp32Compat.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
// Arduino-ESP32 1.0.6 does not define these version macros, but some newer
|
||||
// libraries use them to select legacy-compatible code paths.
|
||||
#ifndef ESP_ARDUINO_VERSION
|
||||
#define EGGDUINO_LEGACY_ARDUINO_ESP32 1
|
||||
#define ESP_ARDUINO_VERSION 0
|
||||
#else
|
||||
#define EGGDUINO_LEGACY_ARDUINO_ESP32 0
|
||||
#endif
|
||||
|
||||
#ifndef ESP_ARDUINO_VERSION_VAL
|
||||
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch))
|
||||
#endif
|
||||
@@ -29,7 +29,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
Button(byte p, ActionCb a): debounce(0), state(1), lastState(1), action(a), pin(p) {
|
||||
Button(byte p, ActionCb a): debounce(0), state(1), lastState(1), pin(p), action(a) {
|
||||
pinMode(pin, INPUT_PULLUP);
|
||||
}
|
||||
|
||||
@@ -56,4 +56,3 @@ public:
|
||||
}; //button
|
||||
|
||||
#endif //__BUTTON_H__
|
||||
|
||||
|
||||
Reference in New Issue
Block a user