![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Public Types | |
| enum | { DLEntryTag = 1 } |
| A tag for type-safe casts done by CastListEntryToParent. More... | |
Public Member Functions | |
| FrtosTimer (const char *name, TickType_t period, bool auto_reload, void *timer_id, TimerCallbackFunction_t cb) | |
| virtual | ~FrtosTimer () |
| void | OnExpired (stk::time::TimerHost *) override |
| Callback invoked by the handler task when this timer expires. | |
| bool | IsActive () const |
| Check whether the timer is currently active. | |
| Ticks | GetDeadline () const |
| Get the absolute time in ticks at which the timer will expire. | |
| Ticks | GetTimestamp () const |
| Get the tick count at which the timer last expired. | |
| uint32_t | GetPeriod () const |
| Get the reload period of the timer. | |
| uint32_t | GetRemainingTicks () const |
| Get remaining ticks until the timer next expires. | |
Static Public Member Functions | |
| static bool | EnsureTimerHost () |
Public Attributes | |
| const char * | m_name |
| TickType_t | m_period |
| bool | m_auto_reload |
| void * | m_timer_id |
| TimerCallbackFunction_t | m_callback |
| bool | m_cb_owned |
Private Types | |
| enum | |
| A tag for type-safe casts done by CastListEntryToParent. More... | |
| typedef DListEntry< Timer, TClosedLoop > | DLEntryType |
| Convenience alias for this entry type. Used to avoid repeating the full template spelling. | |
| typedef DListHead< Timer, TClosedLoop > | DLHeadType |
| Convenience alias for the corresponding list head type. | |
Private Member Functions | |
| STK_NONCOPYABLE_CLASS (Timer) | |
| DLHeadType * | GetHead () |
| Get the list head this entry currently belongs to. | |
| DLEntryType * | GetNext () |
| Get the next entry in the list. | |
| DLEntryType * | GetPrev () |
| Get the previous entry in the list. | |
| bool | IsLinked () const |
| Check whether this entry is currently a member of any list. | |
| operator Timer * () | |
| Implicit conversion to a mutable pointer to the host object (T). | |
| operator const Timer * () const | |
| Implicit conversion to a const pointer to the host object (T). | |
| void | Link (DLHeadType *head, DLEntryType *next, DLEntryType *prev) |
| Wire this entry into a list between prev and next. | |
| void | Unlink () |
| Remove this entry from its current list. | |
Private Attributes | |
| Ticks | m_deadline |
| absolute expiration time (ticks) | |
| Ticks | m_timestamp |
| absolute time at which timer expired (ticks), updated by TimerHost | |
| volatile bool | m_active |
| true if active | |
| volatile bool | m_pending |
| true if pending to be handled | |
| volatile bool | m_rearming |
| true while a CMD_RESTART / CMD_START_OR_RESET is already in the command queue | |
| DLHeadType * | m_head |
Owning list head, or NULL when the entry is not linked. | |
| DLEntryType * | m_next |
Next entry in the list, or NULL (open list boundary) / first entry (closed loop). | |
| DLEntryType * | m_prev |
Previous entry in the list, or NULL (open list boundary) / last entry (closed loop). | |
Definition at line 762 of file freertos_stk.cpp.
|
inherited |
Convenience alias for this entry type. Used to avoid repeating the full template spelling.
Definition at line 75 of file stk_linked_list.h.
|
inherited |
Convenience alias for the corresponding list head type.
Definition at line 80 of file stk_linked_list.h.
|
inherited |
A tag for type-safe casts done by CastListEntryToParent.
| Enumerator | |
|---|---|
| DLEntryTag | |
Definition at line 158 of file stk_time_timer.h.
|
inherited |
A tag for type-safe casts done by CastListEntryToParent.
Definition at line 70 of file stk_linked_list.h.
|
inlineexplicit |
Definition at line 764 of file freertos_stk.cpp.
References m_auto_reload, m_callback, m_cb_owned, m_name, m_period, and m_timer_id.
|
inlinevirtual |
Definition at line 773 of file freertos_stk.cpp.
|
inlinestatic |
Definition at line 780 of file freertos_stk.cpp.
References stk::ACCESS_PRIVILEGED, g_StkKernel, g_TimerHost, and g_TimerHostBuf.
Referenced by xTimerCreate(), xTimerCreateStatic(), and xTimerPendFunctionCall().
|
inlineinherited |
Get the absolute time in ticks at which the timer will expire.
Definition at line 180 of file stk_time_timer.h.
References m_deadline.
Referenced by stk_timer_get_deadline(), and xTimerGetExpiryTime().
|
inlineinherited |
Get the list head this entry currently belongs to.
NULL if the entry is not linked. Definition at line 85 of file stk_linked_list.h.
|
inlineinherited |
Get the next entry in the list.
NULL if this is the last entry (open list) or the first entry (closed loop, where next wraps to first). TClosedLoop == true) this pointer is never NULL when the entry is linked. Definition at line 98 of file stk_linked_list.h.
|
inlineinherited |
Get the reload period of the timer.
Definition at line 191 of file stk_time_timer.h.
References m_period.
Referenced by stk_timer_get_period().
|
inlineinherited |
Get the previous entry in the list.
NULL if this is the first entry (open list) or the last entry (closed loop, where prev wraps to last). TClosedLoop == true) this pointer is never NULL when the entry is linked. Definition at line 114 of file stk_linked_list.h.
|
inlineinherited |
Get remaining ticks until the timer next expires.
Definition at line 478 of file stk_time_timer.h.
References stk::GetTicks(), m_active, and m_deadline.
Referenced by stk_timer_get_remaining_ticks().
|
inlineinherited |
Get the tick count at which the timer last expired.
Definition at line 186 of file stk_time_timer.h.
References m_timestamp.
Referenced by stk_timer_get_timestamp().
|
inlineinherited |
Check whether the timer is currently active.
Definition at line 174 of file stk_time_timer.h.
References m_active.
Referenced by osTimerDelete(), osTimerIsRunning(), osTimerStop(), stk_timer_destroy(), stk_timer_is_active(), xTimerDelete(), xTimerGetExpiryTime(), xTimerStop(), and xTimerStopFromISR().
|
inlineinherited |
Check whether this entry is currently a member of any list.
true if linked (m_head != NULL); false otherwise. Definition at line 127 of file stk_linked_list.h.
|
inlineprivateinherited |
Wire this entry into a list between prev and next.
| [in] | head | The owning DListHead. Stored as a back-pointer for IsLinked() and ownership checks. |
| [in] | next | The entry that will follow this one, or NULL if this becomes the last entry. |
| [in] | prev | The entry that will precede this one, or NULL if this becomes the first entry. |
Definition at line 162 of file stk_linked_list.h.
|
inlineoverridevirtual |
Callback invoked by the handler task when this timer expires.
| [in] | host | Pointer to the TimerHost that fired this timer. |
Implements stk::time::TimerHost::Timer.
Definition at line 775 of file freertos_stk.cpp.
References m_callback.
|
inlineinherited |
Implicit conversion to a const pointer to the host object (T).
Definition at line 141 of file stk_linked_list.h.
|
inlineinherited |
Implicit conversion to a mutable pointer to the host object (T).
Definition at line 134 of file stk_linked_list.h.
|
privateinherited |
|
inlineprivateinherited |
Remove this entry from its current list.
Definition at line 186 of file stk_linked_list.h.
|
privateinherited |
true if active
Definition at line 207 of file stk_time_timer.h.
Referenced by GetRemainingTicks(), IsActive(), stk::time::TimerHost::ProcessCommands(), stk::time::TimerHost::Reset(), stk::time::TimerHost::SetPeriod(), stk::time::TimerHost::Start(), stk::time::TimerHost::Stop(), Timer(), and stk::time::TimerHost::UpdateTime().
| bool FrtosTimer::m_auto_reload |
Definition at line 792 of file freertos_stk.cpp.
Referenced by FrtosTimer(), xTimerChangePeriodFromISR(), xTimerStart(), and xTimerStartFromISR().
| TimerCallbackFunction_t FrtosTimer::m_callback |
Definition at line 794 of file freertos_stk.cpp.
Referenced by FrtosTimer(), and OnExpired().
| bool FrtosTimer::m_cb_owned |
Definition at line 795 of file freertos_stk.cpp.
Referenced by FrtosTimer(), and xTimerCreateStatic().
|
privateinherited |
absolute expiration time (ticks)
Definition at line 204 of file stk_time_timer.h.
Referenced by GetDeadline(), GetRemainingTicks(), stk::time::TimerHost::ProcessCommands(), Timer(), and stk::time::TimerHost::UpdateTime().
|
privateinherited |
Owning list head, or NULL when the entry is not linked.
Definition at line 203 of file stk_linked_list.h.
| const char* FrtosTimer::m_name |
Definition at line 790 of file freertos_stk.cpp.
Referenced by FrtosTimer().
|
privateinherited |
Next entry in the list, or NULL (open list boundary) / first entry (closed loop).
Definition at line 204 of file stk_linked_list.h.
|
privateinherited |
true if pending to be handled
Definition at line 208 of file stk_time_timer.h.
Referenced by stk::time::TimerHost::ProcessCommands(), stk::time::TimerHost::ProcessTimers(), Timer(), and stk::time::TimerHost::UpdateTime().
| TickType_t FrtosTimer::m_period |
Definition at line 791 of file freertos_stk.cpp.
Referenced by FrtosTimer(), xTimerChangePeriod(), xTimerChangePeriodFromISR(), xTimerStart(), and xTimerStartFromISR().
|
privateinherited |
Previous entry in the list, or NULL (open list boundary) / last entry (closed loop).
Definition at line 205 of file stk_linked_list.h.
|
privateinherited |
true while a CMD_RESTART / CMD_START_OR_RESET is already in the command queue
Definition at line 209 of file stk_time_timer.h.
Referenced by stk::time::TimerHost::ProcessCommands(), stk::time::TimerHost::PushCommand(), and Timer().
| void* FrtosTimer::m_timer_id |
Definition at line 793 of file freertos_stk.cpp.
Referenced by FrtosTimer().
|
privateinherited |
absolute time at which timer expired (ticks), updated by TimerHost
Definition at line 205 of file stk_time_timer.h.
Referenced by GetTimestamp(), Timer(), and stk::time::TimerHost::UpdateTime().