Struct freertos_rs::TaskDelayPeriodic
[−]
[src]
pub struct TaskDelayPeriodic { /* fields omitted */ }
Periodic delay timer.
Use inside a polling loop, for example: the loop polls this instance every second.
The method should_run
will return true once 30 seconds or more has elapsed
and it will then reset the timer for that period.
Methods
impl TaskDelayPeriodic
[src]
fn new(period: Duration) -> TaskDelayPeriodic
Create a new timer with the set period.
fn should_run(&mut self) -> bool
Has the set period passed? If it has, resets the internal timer.
fn set_period(&mut self, period: Duration)
Set a new delay period
fn reset(&mut self)
Reset the internal timer to zero.