#include "example.h"
#ifdef _PICO_H
#else
#endif
#define USE_EDF 0
template <stk::EAccessMode _AccessMode>
{
public:
{}
private:
{
for (;;)
{
uint8_t cmd;
{
Led::SwitchOnExclusive(
static_cast<LedId>(cmd));
}
for (volatile uint32_t i = 0; i < 1000; ++i);
}
}
{
(void)duration;
}
};
template <stk::EAccessMode _AccessMode>
{
{
uint8_t led = 0;
stk::time::PeriodicTrigger trigger(1000, true);
for (;;)
{
for (volatile uint32_t i = 0; i < 3000; ++i);
if (trigger.Poll())
{
}
}
}
{
(void)duration;
}
};
{
{
Led::SwitchOnExclusive(Led::RED);
return false;
}
};
{
#if USE_EDF
#else
#endif
#define MSEC(MS) GetTicksFromMs(MS, PERIODICITY_DEFAULT)
#if !USE_EDF
auto wcrt_sched = SchedulabilityCheck::IsSchedulableWCRT<TASK_COUNT>(kernel.
GetSwitchStrategy());
#endif
}
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 primitives: stk::sync::Pipe - runtime-sized byte-stream pipe over a...
Collection of time-related primitives (stk::time namespace).
Namespace of STK package.
static void Yield()
Notify scheduler to switch to the next runnable task.
SwitchStrategyMonotonic< MSS_TYPE_RATE > SwitchStrategyRM
Shorthand alias for SwitchStrategyMonotonic<MSS_TYPE_RATE>: Rate-Monotonic scheduling (shorter schedu...
Concrete implementation of IKernel.
void Start() override
Start the scheduler. This call does not return until all tasks have exited (KERNEL_DYNAMIC mode) or i...
EAddResult AddTask(ITask *user_task) override
Register task for a soft real-time (SRT) scheduling.
IPlatform * GetPlatform() override
Get platform driver instance owned by this kernel.
void Initialize(uint32_t resolution_us=PERIODICITY_DEFAULT) override
Initialize kernel.
ITaskSwitchStrategy * GetSwitchStrategy() override
Get task-switching strategy instance owned by this kernel.
virtual void SetEventOverrider(IEventOverrider *overrider, bool non_secure=false)=0
Set platform event overrider.
Interface for a platform event overrider.
Partial implementation of the user task.
Earliest Deadline First (EDF) scheduling strategy: always selects the runnable task with the least ti...
Thread-safe, type-safe FIFO communication pipe with internal storage.
bool OnHardFault() override
Called by Kernel when hard fault happens.
void OnDeadlineMissed(uint32_t duration)
Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time ...
void Run() override
Entry point of the user task.
static void InitAll(bool init_state)
void OnDeadlineMissed(uint32_t duration)
Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time ...
void Run() override
Entry point of the user task.
HwLedTask(uint8_t task_id)
static stk::sync::PipeT< uint8_t, 1 > g_LedPipe[LED_MAX]