![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Partial implementation of the user task with a compile-time scheduling weight. Use when the kernel is configured with SwitchStrategySmoothWeightedRoundRobin. More...
#include <stk_helper.h>
Public Types | |
| enum | { STACK_SIZE = _StackSize } |
Public Member Functions | |
| 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. | |
| EAccessMode | GetAccessMode () const override |
| Get hardware access mode of the user task. | |
| Weight | GetWeight () const override |
| Get static base weight of the task. | |
| virtual void | Run ()=0 |
| Entry point of the user task. | |
| virtual IStackMemory * | GetSecureStackMemory () |
| Get pointer to the stack memory. | |
| virtual void | OnDeadlineMissed (uint32_t duration) |
| Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time mode (see stk::KERNEL_HRT). | |
| virtual void | OnExit () |
| Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC). | |
| TId | GetId () const |
| Get task Id set by application. | |
| virtual const char * | GetTraceName () const |
| Get task trace name set by application. | |
| virtual size_t | GetStackSpace () const |
| Get available stack space. | |
Protected Member Functions | |
| TaskW (const TaskW &)=delete | |
| TaskW & | operator= (const TaskW &)=delete |
| TaskW () | |
| Initializes task instance and zero-initializes its internal stack memory. | |
| ~TaskW ()=default | |
| Destructor. | |
Private Attributes | |
| StackMemoryDef< _StackSize >::Type | m_stack |
| Stack memory region, 16-byte aligned. | |
Partial implementation of the user task with a compile-time scheduling weight. Use when the kernel is configured with SwitchStrategySmoothWeightedRoundRobin.
| _Weight | Static scheduling weight (positive, non-zero 24-bit integer). Higher values cause this task to receive proportionally more CPU time. |
| _StackSize | Stack size in elements of Word. |
| _AccessMode | Hardware access mode (ACCESS_USER or ACCESS_PRIVILEGED). |
See Task for full usage example and implementation guidance.
Definition at line 95 of file stk_helper.h.
| anonymous enum |
| Enumerator | |
|---|---|
| STACK_SIZE | |
Definition at line 98 of file stk_helper.h.
|
protecteddelete |
|
inlineprotected |
Initializes task instance and zero-initializes its internal stack memory.
The constructor is protected to ensure that the Task class can only be instantiated through a derived subclass. It handles the allocation (if applicable) and zero-initialization of the m_stack member based on the _StackSize template parameter.
Definition at line 115 of file stk_helper.h.
References m_stack.
|
protecteddefault |
|
inlineoverridevirtual |
Get hardware access mode of the user task.
Implements stk::ITask.
Definition at line 102 of file stk_helper.h.
|
inlineinherited |
Get task Id set by application.
Implementation of ITask::GetId, see ITask. Placed here as it depends on GetTidFromUserTask.
Definition at line 228 of file stk_helper.h.
References stk::GetTidFromUserTask().
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Bind(), and stk_task_get_id().
|
inlinevirtualinherited |
Get pointer to the stack memory.
Definition at line 692 of file stk_common.h.
|
inlineoverridevirtual |
Get pointer to the stack memory.
Implements stk::IStackMemory.
Definition at line 100 of file stk_helper.h.
References m_stack.
|
inlineoverridevirtual |
Get number of elements of the stack memory array.
Implements stk::IStackMemory.
Definition at line 101 of file stk_helper.h.
|
inlinevirtualinherited |
Get available stack space.
Definition at line 336 of file stk_common.h.
References stk::ArrayView< T >::GetSize(), GetStack(), GetStackSize(), and STK_STACK_MEMORY_FILLER.
Referenced by FrtosTask::GetStackHighWaterMark(), and osThreadGetStackSpace().
|
inlinevirtualinherited |
Get task trace name set by application.
NULL if unused. Reimplemented in FrtosTask, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Definition at line 735 of file stk_common.h.
|
inlineoverridevirtual |
Get static base weight of the task.
Reimplemented from stk::ITask.
Definition at line 103 of file stk_helper.h.
|
inlinevirtualinherited |
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 in FrtosTask, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Definition at line 705 of file stk_common.h.
References STK_UNUSED.
|
inlinevirtualinherited |
Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC).
Reimplemented in FrtosTask, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Definition at line 715 of file stk_common.h.
|
protecteddelete |
|
pure virtualinherited |
Entry point of the user task.
Kernel is configured as KERNEL_STATIC, the body must contain an infinite loop. Implemented in FrtosTask, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
|
private |
Stack memory region, 16-byte aligned.
Definition at line 123 of file stk_helper.h.
Referenced by GetStack(), and TaskW().