10#include <stk_config.h>
21#define _STK_CHAIN_TEST_TASKS_MAX 3
22#define _STK_CHAIN_TEST_DELAY_TIME 100
38template <EAccessMode _AccessMode>
66 printf(
"id=%d time=%d\n", task_id, (
int)
g_Time[task_id]);
86int main(
int argc,
char **argv)
112 printf(
"failed time: id=%d diff=%d (>25)\n", (
int)i, (
int)diff);
Top-level STK include. Provides the Kernel class template and all built-in task-switching strategies.
int main(int argc, char **argv)
#define _STK_CHAIN_TEST_DELAY_TIME
#define _STK_CHAIN_TEST_TASKS_MAX
#define STK_TEST_DECL_ASSERT
Declare assertion redirector in the source file.
Namespace of STK package.
static int64_t GetTimeNowMs()
Get current time in milliseconds since kernel start.
void Delay(uint32_t ticks)
Delay calling process by busy-waiting until the deadline expires.
Namespace of the test inventory.
static Kernel< KERNEL_DYNAMIC, 3, SwitchStrategyRoundRobin, PlatformDefault > kernel
Kernel.
static TestTask< ACCESS_PRIVILEGED > task3(2)
static TestTask< ACCESS_PRIVILEGED > task1(0)
Tasks (threads).
static TestTask< ACCESS_PRIVILEGED > task2(1)
static int64_t g_Time[3]
Execution time of the task.
static volatile uint8_t g_TaskSwitch
Concrete implementation of IKernel.
Task(const Task &)=delete
TestTask(uint8_t task_id)
void Run()
Entry point of the user task.
static void ShowTestSuitePrologue()
Show text string as prologue before tests start.
@ DEFAULT_FAILURE_EXIT_CODE
default exit code for exit() to denote failure of the test
@ SUCCESS_EXIT_CODE
exit code for exit() to denote the success of the test
static void ShowTestSuiteEpilogue(int32_t result)
Show text string as epilogue after tests end.