10#include <stk_config.h>
21#define _STK_SLEEP_TEST_TASKS_MAX 3
22#define _STK_SLEEP_TEST_SLEEP_TIME 100
38template <EAccessMode _AccessMode>
60 printf(
"id=%d time=%d\n",
m_task_id, (
int)diff);
79int main(
int argc,
char **argv)
109 printf(
"failed time: id=%d diff=%d (>20)\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_SLEEP_TEST_TASKS_MAX
#define _STK_SLEEP_TEST_SLEEP_TIME
#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 Sleep(uint32_t ticks)
Put calling process into a sleep state.
Namespace of the test inventory.
static Kernel< KERNEL_DYNAMIC, 3, SwitchStrategyRoundRobin, PlatformDefault > kernel
Kernel.
static TestTask< ACCESS_PRIVILEGED > task2(1)
static TestTask< ACCESS_PRIVILEGED > task3(2)
static TestTask< ACCESS_PRIVILEGED > task1(0)
Tasks (threads).
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.