Low Power Ticker.
More...
#include <LowPowerTicker.h>
Low Power Ticker.
- Note
- Synchronization level: Interrupt safe
Definition at line 42 of file LowPowerTicker.h.
◆ attach() [1/2]
Attach a function to be called by the Ticker, specifying the interval in seconds.
The method forwards its arguments to attach_us() rather than copying them which may not be trivial depending on the callback copied. The function is forcibly inlined to not use floating-point operations. This is possible given attach_us() expects an integer value for the callback interval.
- Parameters
-
func | pointer to the function to be called |
t | the time between calls in seconds |
- Deprecated:
- Pass a chrono duration, not a float second count. For example use
10ms
rather than 0.01f
.
Definition at line 92 of file Ticker.h.
◆ attach() [2/2]
void attach |
( |
Callback< void()> |
func, |
|
|
std::chrono::microseconds |
t |
|
) |
| |
|
inherited |
Attach a function to be called by the Ticker, specifying the interval in microseconds.
- Parameters
-
func | pointer to the function to be called |
t | the time between calls in micro-seconds |
- Note
- setting t to a value shorter than it takes to process the ticker callback causes the system to hang. Ticker callback is called constantly with no time for threads scheduling.
◆ attach_us()
Attach a function to be called by the Ticker, specifying the interval in microseconds.
- Parameters
-
func | pointer to the function to be called |
t | the time between calls in micro-seconds |
- Note
- setting t to a value shorter than it takes to process the ticker callback causes the system to hang. Ticker callback is called constantly with no time for threads scheduling.
- Deprecated:
- Pass a chrono duration, not an integer microsecond count. For example use
10ms
rather than 10000
.
◆ detach()