Segfault when timer.done() is called before timer.start()
Opened this issue · 0 comments
DotOnedotNL commented
When creating a new timer _timer.started is left uninitialised, it will be set when .start() is called.
If after initialisation .done() is called a segfault occurs and the sketch crashes.
it can be solved quickly by defining _timer.started during initialisation.
//Default constructor
Neotimer::Neotimer(){
this->_timer.time = 1000; //Default 1 second interval if not specified
this->_timer.started = false;
}
Neotimer::Neotimer(long _t){
this->_timer.time = _t;
this->_timer.started = false;