1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-15 00:02:49 +03:00

Implementation of Functional and Scheduled option in Ticker lib (#5030)

* Implementation of Functional and Scheduled option in Ticker lib

* Update example formatting

* More example updates

* More updates to example

* More updates to example
This commit is contained in:
hreintke
2018-08-14 21:00:20 +02:00
committed by Develo
parent cbcefa7d3f
commit adde93bcaa
3 changed files with 115 additions and 9 deletions

View File

@ -65,9 +65,23 @@ void Ticker::detach()
os_timer_disarm(_timer);
delete _timer;
_timer = nullptr;
_callback_function = nullptr;
}
bool Ticker::active()
{
return (bool)_timer;
}
void Ticker::_static_callback(void* arg)
{
Ticker* _this = (Ticker*)arg;
if (_this == nullptr)
{
return;
}
if (_this->_callback_function)
{
_this->_callback_function();
}
}