Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
main.c File Reference
#include <zephyr.h>
#include <ztest.h>
#include <kernel.h>

Macros

#define WAIT_MS   10 /* Time to wait/sleep between actions */
 
#define LOOP_CNT   4 /* Number of times low priority thread waits */
 

Functions

 K_SEM_DEFINE (metairq_sem, 0, 1)
 
 K_SEM_DEFINE (coop_sem1, 0, 1)
 
 K_SEM_DEFINE (coop_sem2, 0, 1)
 
void metairq_thread (void)
 
void coop_thread1 (void)
 
void coop_thread2 (void)
 
 K_THREAD_DEFINE (metairq_thread_id, 1024, metairq_thread, 0, 0, 0, K_PRIO_COOP(0), 0, 0)
 
 K_THREAD_DEFINE (coop_thread1_id, 1024, coop_thread1, 0, 0, 0, K_PRIO_COOP(1), 0, 0)
 
 K_THREAD_DEFINE (coop_thread2_id, 1024, coop_thread2, 0, 0, 0, K_PRIO_COOP(2), 0, 0)
 
void test_preempt (void)
 
void test_main (void)
 

Variables

volatile int coop_cnt1
 
volatile int coop_cnt2
 

Macro Definition Documentation

◆ LOOP_CNT

#define LOOP_CNT   4 /* Number of times low priority thread waits */

◆ WAIT_MS

#define WAIT_MS   10 /* Time to wait/sleep between actions */

Function Documentation

◆ coop_thread1()

void coop_thread1 ( void  )

◆ coop_thread2()

void coop_thread2 ( void  )

◆ K_SEM_DEFINE() [1/3]

K_SEM_DEFINE ( coop_sem1  ,
,
 
)

◆ K_SEM_DEFINE() [2/3]

K_SEM_DEFINE ( coop_sem2  ,
,
 
)

◆ K_SEM_DEFINE() [3/3]

K_SEM_DEFINE ( metairq_sem  ,
,
 
)

◆ K_THREAD_DEFINE() [1/3]

K_THREAD_DEFINE ( coop_thread1_id  ,
1024  ,
coop_thread1  ,
,
,
,
K_PRIO_COOP(1)  ,
,
 
)

◆ K_THREAD_DEFINE() [2/3]

K_THREAD_DEFINE ( coop_thread2_id  ,
1024  ,
coop_thread2  ,
,
,
,
K_PRIO_COOP(2)  ,
,
 
)

◆ K_THREAD_DEFINE() [3/3]

K_THREAD_DEFINE ( metairq_thread_id  ,
1024  ,
metairq_thread  ,
,
,
,
K_PRIO_COOP(0)  ,
,
 
)

◆ metairq_thread()

void metairq_thread ( void  )

◆ test_main()

void test_main ( void  )

test case main entry

◆ test_preempt()

void test_preempt ( void  )

Variable Documentation

◆ coop_cnt1

volatile int coop_cnt1

◆ coop_cnt2

volatile int coop_cnt2