![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Internal kernel task used by TimerHost for both the tick task and handler tasks. More...
Public Member Functions | |
| TimerWorkerTask () | |
| Default constructor. All members are zero/null-initialized. | |
| EAccessMode | GetAccessMode () const override |
| Get hardware access mode of the user task. | |
| void | OnDeadlineMissed (uint32_t) override |
| Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time mode (see stk::KERNEL_HRT). | |
| void | OnExit () override |
| Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC). | |
| int32_t | GetWeight () const override |
| Get static base weight of the task. | |
| const char * | GetTraceName () const override |
| Get task trace name set by application. | |
| const Word * | GetStack () const override |
| Get pointer to the stack memory. | |
| size_t | GetStackSize () const override |
| Get number of elements of the stack memory array. | |
| size_t | GetStackSizeBytes () const override |
| Get size of the memory in bytes. | |
| void | Initialize (TimerHost *host, Word *stack, size_t stack_size, EAccessMode mode, TimerFuncType const func) |
| Bind this task to a host, stack buffer, access mode, and entry function. | |
| void | SetWeight (int32_t weight) |
| Override the scheduling weight assigned by Initialize(). | |
| TId | GetId () const |
| Get task Id set by application. | |
| virtual size_t | GetStackSpace () const |
| Get available stack space. | |
Private Member Functions | |
| void | Run () override |
| Timer task entry point. | |
Private Attributes | |
| TimerFuncType | m_func |
| entry function (tick loop or handler loop) | |
| TimerHost * | m_host |
| owning TimerHost instance | |
| Word * | m_stack |
| pointer to stack buffer | |
| size_t | m_stack_size |
| stack size in words | |
| EAccessMode | m_mode |
| kernel access mode | |
| int32_t | m_weight |
| scheduling weight | |
Internal kernel task used by TimerHost for both the tick task and handler tasks.
Wraps a free function pointer (TimerFuncType) so that the same ITask-derived class can serve either role (tick or handler) with different stack buffers, access modes, and entry points supplied at Initialize() time.
Definition at line 330 of file stk_time_timer.h.
|
inlineexplicit |
Default constructor. All members are zero/null-initialized.
Definition at line 334 of file stk_time_timer.h.
References stk::ACCESS_USER, stk::DEFAULT_WEIGHT, m_func, m_host, m_mode, m_stack, m_stack_size, and m_weight.
|
inlineoverridevirtual |
Get hardware access mode of the user task.
Implements stk::ITask.
Definition at line 340 of file stk_time_timer.h.
References m_mode.
|
inlineinherited |
Get task Id set by application.
Implementation of ITask::GetId, see ITask. Placed here as it depends on GetTidFromUserTask.
Definition at line 234 of file stk_helper.h.
References stk::GetTidFromUserTask().
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Bind(), and stk_task_get_id().
|
inlineoverridevirtual |
Get pointer to the stack memory.
Implements stk::IStackMemory.
Definition at line 347 of file stk_time_timer.h.
References m_stack.
|
inlineoverridevirtual |
Get number of elements of the stack memory array.
Implements stk::IStackMemory.
Definition at line 348 of file stk_time_timer.h.
References m_stack_size.
|
inlineoverridevirtual |
Get size of the memory in bytes.
Implements stk::IStackMemory.
Definition at line 349 of file stk_time_timer.h.
References m_stack_size.
|
inlinevirtualinherited |
Get available stack space.
Definition at line 319 of file stk_common.h.
References stk::ArrayView< T >::GetSize(), GetStack(), GetStackSize(), and STK_STACK_MEMORY_FILLER.
Referenced by FrtosTask::GetStackHighWaterMark(), and osThreadGetStackSpace().
|
inlineoverridevirtual |
Get task trace name set by application.
NULL if unused. Reimplemented from stk::ITask.
Definition at line 344 of file stk_time_timer.h.
|
inlineoverridevirtual |
Get static base weight of the task.
Reimplemented from stk::ITask.
Definition at line 343 of file stk_time_timer.h.
References m_weight.
|
inline |
Bind this task to a host, stack buffer, access mode, and entry function.
| [in] | host | TimerHost instance this task belongs to. |
| [in] | stack | Pointer to the pre-allocated stack memory. |
| [in] | stack_size | Stack size in words. |
| [in] | mode | Kernel access mode (user or privileged). |
| [in] | func | Entry function called in the task's context. |
Definition at line 359 of file stk_time_timer.h.
References stk::DEFAULT_WEIGHT, m_func, m_host, m_mode, m_stack, m_stack_size, m_weight, and stk::time::TimerHost::TimerHost().
|
inlineoverridevirtual |
Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time mode (see stk::KERNEL_HRT).
| [in] | duration | Elapsed active time in ticks at the point the deadline was detected. Always greater than the task's configured deadline (ticks). |
Reimplemented from stk::ITask.
Definition at line 341 of file stk_time_timer.h.
|
inlineoverridevirtual |
Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC).
Reimplemented from stk::ITask.
Definition at line 342 of file stk_time_timer.h.
|
inlineoverrideprivatevirtual |
|
inline |
Override the scheduling weight assigned by Initialize().
| [in] | weight | New scheduling weight value. |
Definition at line 373 of file stk_time_timer.h.
References m_weight.
|
private |
entry function (tick loop or handler loop)
Definition at line 379 of file stk_time_timer.h.
Referenced by Initialize(), Run(), and TimerWorkerTask().
|
private |
owning TimerHost instance
Definition at line 380 of file stk_time_timer.h.
Referenced by Initialize(), Run(), and TimerWorkerTask().
|
private |
kernel access mode
Definition at line 383 of file stk_time_timer.h.
Referenced by GetAccessMode(), Initialize(), and TimerWorkerTask().
|
private |
pointer to stack buffer
Definition at line 381 of file stk_time_timer.h.
Referenced by GetStack(), Initialize(), and TimerWorkerTask().
|
private |
stack size in words
Definition at line 382 of file stk_time_timer.h.
Referenced by GetStackSize(), GetStackSizeBytes(), Initialize(), and TimerWorkerTask().
|
private |
scheduling weight
Definition at line 384 of file stk_time_timer.h.
Referenced by GetWeight(), Initialize(), SetWeight(), and TimerWorkerTask().