85 for (uint8_t i = 0; i <
LED_MAX; i++)
void Led_InitAll(bool state)
void Led_SwitchOnExclusive(LedId led)
C language binding/interface for SuperTinyKernel RTOS.
C language bindings for stk::memory::BlockMemoryPool, stk::memory::BytePool and stk::memory::MemoryAl...
C language binding for stk::time::TimerHost and stk::time::Timer.
#define STK_EF_OPT_WAIT_ANY
Options bitmask constants for stk_ef_wait() / stk_ef_trywait().
#define STK_WAIT_INFINITE
Infinite timeout constant.
#define STK_GET_STACK_FROM_POOL(name, task_id)
Retrieves the base stack pointer for a specific task ID from a stack pool.
stk_ef_t * stk_ef_create(stk_ef_mem_t *const membuf, stk_ef_val_t initial_flags)
Create an EventFlags object (using provided memory).
static bool stk_ef_is_error(stk_ef_val_t result)
Returns true if a value returned by stk_ef_set(), stk_ef_clear(), stk_ef_wait(), or stk_ef_trywait() ...
struct stk_kernel_t stk_kernel_t
Opaque handle to a kernel instance.
void stk_kernel_start(stk_kernel_t *k)
Start the scheduler - never returns.
#define STK_C_KERNEL_MAX_TASKS
Maximum number of tasks per kernel instance (default: 4).
stk_add_result_t stk_kernel_add_task(stk_kernel_t *k, stk_task_t *tsk)
Add task to non-HRT kernel (static or dynamic).
void stk_sleep_ms(stk_timeout_t ms)
Put current task to sleep (non-HRT kernels only).
#define STK_DEFINE_STACK_POOL(name, max_tasks, stack_size)
Allocates a statically bound, multi-dimensional stack pool for tasks.
#define STK_PERIODICITY_DEFAULT
Default tick period (1 ms).
void stk_kernel_init(stk_kernel_t *k, uint32_t tick_period_us)
Initialize kernel with given tick period.
stk_task_t * stk_task_create_privileged(stk_task_entry_t entry, void *arg, stk_word_t *stack, uint32_t stack_size)
Create privileged-mode (kernel-mode) task.
void stk_critical_section_enter()
Enter global critical section - disable context switches on current core.
stk_kernel_t * stk_kernel_create(uint8_t core_nr)
Create kernel.
#define STK_C_ASSERT(e)
Assertion macro used inside STK C bindings.
stk_ef_val_t stk_ef_set(stk_ef_t *ef, stk_ef_val_t flags)
Set one or more flags.
stk_ef_val_t stk_ef_wait(stk_ef_t *ef, stk_ef_val_t flags, uint32_t options, stk_timeout_t timeout)
Wait for one or more flags to be set.
void stk_critical_section_exit()
Leave global critical section - re-enable context switches.
Opaque memory container for an EventFlags instance.
static const uint32_t FLAGS_ALL[]
static stk::sync::EventFlags g_TaskFlags(FLAGS_ALL[LED_RED])
static stk_ef_mem_t g_TaskFlagsMem
static TaskArg g_TaskArgs[LED_MAX]