1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

lib/Ticker: add bool active() (#2722)

* lib/Ticker: add bool active()

Makes it easier to self detach, and check if a timer is still operating.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>

* Code cleanup Ticker.cpp
This commit is contained in:
Karl Palsson
2018-01-05 04:04:53 +00:00
committed by Develo
parent 9cfbbc7ad3
commit 89837fcea5
3 changed files with 12 additions and 6 deletions

View File

@ -23,6 +23,7 @@
#define TICKER_H
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
extern "C" {
@ -93,6 +94,7 @@ public:
}
void detach();
bool active();
protected:
void _attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t callback, uint32_t arg);