62 Led::Id led = stk::hw::GetTlsPtr<MyTls>()->led;
76template <u
int8_t _TaskId, Led::Id _LedId, stk::EAccessMode _AccessMode>
92 stk::hw::SetTlsPtr(&
m_tls);
101 g_Sem[_TaskId]->Wait();
117 g_Sem[(_TaskId + 1) % 4]->Signal();
142 kernel.AddTask(&task1);
143 kernel.AddTask(&task2);
144 kernel.AddTask(&task3);
145 kernel.AddTask(&task4);
Top-level STK include. Provides the Kernel class template and all built-in task-switching strategies.
#define STK_ASSERT(e)
Runtime assertion. Halts execution if the expression e evaluates to false.
Implementation of synchronization primitive: stk::sync::SemaphoreT and stk::sync::Semaphore.
Namespace of STK package.
int64_t Ticks
Ticks value.
static bool SleepUntil(Ticks timestamp)
Put calling process into a sleep state until the specified timestamp.
static Ticks GetTicksFromMs(Time ms, uint32_t resolution)
Convert milliseconds to ticks.
static Ticks GetTicks()
Get number of ticks elapsed since kernel start.
PlatformArmCortexM PlatformDefault
Default platform implementation.
@ KERNEL_TICKLESS
Tickless mode. To use this mode STK_TICKLESS_IDLE must be defined to 1 in stk_config....
@ KERNEL_SYNC
Synchronization support (see Event).
@ KERNEL_STATIC
All tasks are static and can not exit.
SwitchStrategyRoundRobinT< false > SwitchStrategyRR
Shorthand alias for SwitchStrategyRoundRobin.
SemaphoreT< uint16_t > Semaphore
Default counting semaphore with a 16-bit counter (max count 0xFFFF).
Concrete implementation of IKernel.
Partial implementation of the user task.
void Run() override
Entry point of the user task.
static void InitAll(bool init_state)
static void SwitchOnExclusive(Id led)
static stk::Ticks g_Timeline
static stk::Ticks g_Timeline
static stk::sync::Semaphore g_Sem1(0)
static void SwitchOnLED()
static stk::sync::Semaphore *const g_Sem[LED_MAX]
static stk::sync::Semaphore g_Sem3(0)
static stk::sync::Semaphore g_Sem2(0)
static stk::sync::Semaphore g_Sem0(1)