Class CycleTimer
Defined in File sim_cycle_timer.h
Inheritance Relationships
Derived Types
public BoundFunctionCycleTimer< UART::USART >(Template Class BoundFunctionCycleTimer)public BoundFunctionCycleTimer< ArchAVR_WDT >(Template Class BoundFunctionCycleTimer)public ArchAVR_NVM::EE_Timer(Class ArchAVR_NVM::EE_Timer)public ArchAVR_NVM::SPM_Timer(Class ArchAVR_NVM::SPM_Timer)public ArchAVR_SPI::_Controller(Class ArchAVR_SPI::_Controller)public ArchXT_NVM::Timer(Class ArchXT_NVM::Timer)public ArchXT_SPI::_Controller(Class ArchXT_SPI::_Controller)public BoundFunctionCycleTimer< C >(Template Class BoundFunctionCycleTimer)public PrescaledTimer(Class PrescaledTimer)public TWI::Client(Class Client)public TWI::Host(Class Host)public WatchdogTimer::WDR_Sync_Timer(Class WatchdogTimer::WDR_Sync_Timer)public WatchdogTimer::WDT_Timer(Class WatchdogTimer::WDT_Timer)
Class Documentation
-
class CycleTimer
Abstract interface for timers that can register with the cycle manager and be scheduled to be called at a given cycle.
Subclassed by BoundFunctionCycleTimer< UART::USART >, BoundFunctionCycleTimer< ArchAVR_WDT >, ArchAVR_NVM::EE_Timer, ArchAVR_NVM::SPM_Timer, ArchAVR_SPI::_Controller, ArchXT_NVM::Timer, ArchXT_SPI::_Controller, BoundFunctionCycleTimer< C >, PrescaledTimer, TWI::Client, TWI::Host, WatchdogTimer::WDR_Sync_Timer, WatchdogTimer::WDT_Timer
Public Functions
-
CycleTimer()
-
CycleTimer(const CycleTimer &other)
-
virtual ~CycleTimer()
-
inline bool scheduled() const
Returns true if this timer is scheduled with a manager.
-
bool paused() const
Returns true if this timer is scheduled and paused
-
cycle_count_t remaining_delay() const
Returns the remaining delay before this timer is called, or -1 if the timer isn’t scheduled.
-
virtual cycle_count_t next(cycle_count_t when) = 0
Callback from the cycle loop.
Note
there’s no guarantee the method will be called exactly on the required ‘when’ cycle. The only guarantee is “called ‘when’ <= ‘current cycle’”, the implementations must account for this.
Note
The next ‘when’ can be in the ‘past’ (i.e. <= ‘current cycle’). In this case, the timer will be called again within the same cycle with the given next ‘when’. The only constraint is that it must be greater than the previous ‘when’. If it’s negative or zero, the timer is removed from the queue.
- Parameters:
when – current ‘when’ cycle, at which the timer was scheduled
- Returns:
the next ‘when’ the timer requires to be called at.
-
CycleTimer &operator=(const CycleTimer &other)
-
CycleTimer()