Hello,
The Ticker lib is used years for ESP8266, no problems.
For ESP32 the build fails.
Platformio finds the active()
function definition and implementation. However, the linking does not pass.
Restart Platformio does not help.
Clean up .pio
and .vscode
folders does not help.
Rename main.cpp to main.ino does not help.
Code:
#include <ESP32Ticker.h>
//#include <Ticker.h> // Either lib gives the same error.
Ticker touch_outside_timer;
void callbackOutside(){
if (! touch_outside_timer.active()) {
touch_outside_ts = millis();
}
touch_outside_timer.once(0.1, stopTouchOutside);
}
Error in build:
Archiving .pio\build\wemosbat\libFrameworkArduino.a
Linking .pio\build\wemosbat\firmware.elf
.pio\build\wemosbat\src\main.cpp.o:(.literal._Z15callbackOutsidev+0x8): undefined reference to `Ticker::active()'
.pio\build\wemosbat\src\main.cpp.o: In function `callbackOutside()':
.../src/main.cpp:137: undefined reference to `Ticker::active()'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\wemosbat\firmware.elf] Error 1
All searches for the topic show that it’s really missing definition or reference.
Please, hint where it could be a problem?
Why liner does not see what Pio sees?
Thank you.