Time starts sporadic
Posted: Mon Jan 15, 2018 9:39 am
Hallo community,
for my current project i need a Timer.
Currently I use the following code for the timer https://github.com/michaelbecker/freert ... /timer.hpp, with some changes in code.
In order to make it possible to call a Member-Function, I removed the
virtual function run
and added a void notify member function to Timer which should call the callback function given as a parameter to the constructor of Timer.
The Callback-Function is defined like:
Example of construct the Timer:
Now the Problem:
The Timer does not start reliably. In most cases when i press the reboot button of the esp32 the timer starts.
Do i need the IRAM_ATTR for the called member-function or do I forget something else?
EDIT:
btw i dont get any error or warning when the timer does not run/start.
for my current project i need a Timer.
Currently I use the following code for the timer https://github.com/michaelbecker/freert ... /timer.hpp, with some changes in code.
In order to make it possible to call a Member-Function, I removed the
virtual function run
and added a void notify member function to Timer which should call the callback function given as a parameter to the constructor of Timer.
The Callback-Function is defined like:
Code: Select all
std::function<void(Timer*)> CallbackFunc;
Example of construct the Timer:
Code: Select all
Timer* t1 = new Timer("", 1000, std::bind(&Class::Func, this, std::placeholders_1));
The Timer does not start reliably. In most cases when i press the reboot button of the esp32 the timer starts.
Do i need the IRAM_ATTR for the called member-function or do I forget something else?
EDIT:
btw i dont get any error or warning when the timer does not run/start.