|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Blinky built on the STK pthread API (stk_c_pthread.h). More...
Go to the source code of this file.
Macros | |
| #define | PT_CHECK(call) |
Enumerations | |
| enum | { MAIN_STACK_SIZE = 256 , THREAD_STACK_SIZE = 256 } |
Functions | |
| STK_DEFINE_STACK_POOL (g_MainStack, 1, MAIN_STACK_SIZE) | |
| STK_DEFINE_STACK_POOL (g_ThreadStack, LED_MAX, THREAD_STACK_SIZE) | |
| static void * | LedThread (void *arg) |
| static void | MainTask (void *arg) |
| void | RunExample () |
Variables | |
| static pthread_mutex_t | g_Lock = PTHREAD_MUTEX_INITIALIZER |
| static pthread_cond_t | g_Turn = PTHREAD_COND_INITIALIZER |
| static uint32_t | g_Baton = LED_RED |
| static stk_tick_t | g_Timeline = 0 |
| static pthread_t | g_Threads [LED_MAX] |
Blinky built on the STK pthread API (stk_c_pthread.h).
Definition in file blinky_c-pthread/example.c.
| #define PT_CHECK | ( | call | ) |
Definition at line 52 of file blinky_c-pthread/example.c.
Referenced by LedThread(), and MainTask().
| anonymous enum |
| Enumerator | |
|---|---|
| MAIN_STACK_SIZE | |
| THREAD_STACK_SIZE | |
Definition at line 35 of file blinky_c-pthread/example.c.
|
static |
Definition at line 54 of file blinky_c-pthread/example.c.
References g_Baton, g_Lock, g_Timeline, g_Turn, LED_MAX, Led_SwitchOnExclusive(), PT_CHECK, pthread_cond_broadcast(), pthread_cond_wait(), pthread_mutex_lock(), pthread_mutex_unlock(), stk_critical_section_enter(), stk_critical_section_exit(), stk_sleep_until(), and stk_ticks_from_ms().
Referenced by MainTask().
|
static |
Definition at line 92 of file blinky_c-pthread/example.c.
References g_Lock, g_Threads, g_Timeline, g_Turn, LED_MAX, LedThread(), PT_CHECK, pthread_attr_destroy(), pthread_attr_init(), pthread_attr_setprivileged_np(), pthread_attr_setstack(), pthread_cond_init(), pthread_create(), PTHREAD_CREATE_PRIVILEGED_NP, pthread_join(), pthread_mutex_init(), STK_GET_STACK_FROM_POOL, and stk_ticks().
Referenced by RunExample().
| void RunExample | ( | void | ) |
Definition at line 126 of file blinky_c-pthread/example.c.
References Led_InitAll(), MAIN_STACK_SIZE, MainTask(), STK_C_ASSERT, STK_GET_STACK_FROM_POOL, stk_kernel_add_task(), stk_kernel_create(), stk_kernel_init(), stk_kernel_start(), STK_PERIODICITY_DEFAULT, stk_pthread_bind_kernel(), and stk_task_create_user().
| STK_DEFINE_STACK_POOL | ( | g_MainStack | , |
| 1 | , | ||
| MAIN_STACK_SIZE | ) |
References MAIN_STACK_SIZE.
| STK_DEFINE_STACK_POOL | ( | g_ThreadStack | , |
| LED_MAX | , | ||
| THREAD_STACK_SIZE | ) |
References LED_MAX, and THREAD_STACK_SIZE.
|
static |
Definition at line 44 of file blinky_c-pthread/example.c.
Referenced by LedThread().
|
static |
Definition at line 42 of file blinky_c-pthread/example.c.
Referenced by LedThread(), and MainTask().
Definition at line 49 of file blinky_c-pthread/example.c.
Referenced by MainTask().
|
static |
Definition at line 47 of file blinky_c-pthread/example.c.
|
static |
Definition at line 43 of file blinky_c-pthread/example.c.
Referenced by LedThread(), and MainTask().