You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use multiple timer, I meet a strange behaviour that:
If I start timer #0 #1#2, timer #1 will never execute its callback function.(but without crash)
If I start timer #0 #2, it works fine.
If I start timer #1#2, timer #1 don't execute its callback function.
I further demostrate this problem in the below sketch that use 4 timer. Here the callback function do simple increment. By observing Serial Output we can know which timer is enabled.
By comment "timerStart" we can get multiple timer combination, which timer#1 never "work" when timer#2 is started.
When start only timer#1, it will execute callback function of timer#2;
If I delete the initiation code of timer#2, timer#1 will execute its own callback function.
Because of this "crosstalk", only #0, #2, #3 counter increase if you open all 4 timers.
I wonder there's no hardware limit in the 4 timer. They run indenpendently, and even, I can run all 4 timer when coding in ESP32-IDF style, bypassing the Arduino function. Code is here:
Board
WEMOS LOLIN32 LITE
Device Description
No other hardware, just on breadboard.
Hardware Configuration
No hardware needed.
Version
v2.0.3
IDE Name
Arduino IDE
Operating System
Windows 10 1809
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
115200
Description
When I try to use multiple timer, I meet a strange behaviour that:
If I start timer #0 #1 #2, timer #1 will never execute its callback function.(but without crash)
If I start timer #0 #2, it works fine.
If I start timer #1 #2, timer #1 don't execute its callback function.
I further demostrate this problem in the below sketch that use 4 timer. Here the callback function do simple increment. By observing Serial Output we can know which timer is enabled.
By comment "timerStart" we can get multiple timer combination, which timer#1 never "work" when timer#2 is started.
When start only timer#1, it will execute callback function of timer#2;
If I delete the initiation code of timer#2, timer#1 will execute its own callback function.
Because of this "crosstalk", only #0, #2, #3 counter increase if you open all 4 timers.
I wonder there's no hardware limit in the 4 timer. They run indenpendently, and even, I can run all 4 timer when coding in ESP32-IDF style, bypassing the Arduino function. Code is here:
So I guess there may be some mistake in Arduino implementation for Timer.
Could you please help?
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: