1#ifndef SBL_CORE_PATTERNS_TIMING_NON_BLOCKING_DELAY_HPP_
2#define SBL_CORE_PATTERNS_TIMING_NON_BLOCKING_DELAY_HPP_
30template<
typename SystemTimeImpl>
44 last_trigger_ = SystemTimeImpl::millis();
53 if (!active_)
return false;
54 return (SystemTimeImpl::millis() - last_trigger_) >= period_;
61 last_trigger_ = SystemTimeImpl::millis();
108template<
typename SystemTimeImpl>
122 last_trigger_ = SystemTimeImpl::millis();
131 if (!active_)
return false;
133 uint32_t now = SystemTimeImpl::millis();
134 if ((now - last_trigger_) >= interval_) {
Generic interrupt-driven interval timer.
void start()
Start the interval timer.
bool tick()
Check if interval has elapsed and auto-reset.
uint32_t getInterval() const
Get current interval.
void stop()
Stop the interval timer.
void setInterval(uint32_t interval_ms)
Update interval period.
IntervalTimer(uint32_t interval_ms)
Constructor with interval period.
Simple non-blocking delay using system time.
void stop()
Stop the delay timer.
bool isActive() const
Check if timer is active.
uint32_t getPeriod() const
Get current delay period.
void start()
Start the delay timer.
bool ready() const
Check if delay period has elapsed.
NonBlockingDelay(uint32_t delay_ms)
Constructor with delay period.
void reset()
Reset the delay timer for next period.
void setPeriod(uint32_t delay_ms)
Update delay period.
Root namespace for all Sound Byte Libs functionality.
System timing functions for cooperative scheduling.