Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
main.c File Reference
#include <tc_util.h>
#include <ztest.h>
#include <arch/cpu.h>
#include <sys/util.h>
#include <irq_offload.h>
#include <stdbool.h>

Macros

#define THREAD_STACK   (384 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define TEST_THREAD_PRIORITY   -4
 
#define HELPER_THREAD_PRIORITY   -10
 
#define ONE_SECOND   (MSEC_PER_SEC)
 
#define ONE_SECOND_ALIGNED    (uint32_t)(k_ticks_to_ms_floor64(k_ms_to_ticks_ceil32(ONE_SECOND) + _TICK_ALIGN))
 
#define TICK_MARGIN   1
 

Functions

static K_THREAD_STACK_DEFINE (test_thread_stack,(384+CONFIG_TEST_EXTRA_STACKSIZE))
 
static K_THREAD_STACK_DEFINE (helper_thread_stack,(384+CONFIG_TEST_EXTRA_STACKSIZE))
 
static void test_objects_init (void)
 
static void align_to_tick_boundary (void)
 
static int sleep_time_valid (uint32_t start, uint32_t end, uint32_t dur)
 
static void test_thread (int arg1, int arg2)
 
static void irq_offload_isr (const void *arg)
 
static void helper_thread (int arg1, int arg2)
 
void test_sleep (void)
 Test sleep functionality. More...
 
void test_usleep (void)
 
static void forever_thread_entry (void *p1, void *p2, void *p3)
 
void test_sleep_forever (void)
 
void test_main (void)
 

Variables

static struct k_sem test_thread_sem
 
static struct k_sem helper_thread_sem
 
static struct k_sem task_sem
 
static k_tid_t test_thread_id
 
static k_tid_t helper_thread_id
 
static struct k_thread test_thread_data
 
static struct k_thread helper_thread_data
 
static bool test_failure = true
 

Macro Definition Documentation

◆ HELPER_THREAD_PRIORITY

#define HELPER_THREAD_PRIORITY   -10

◆ ONE_SECOND

#define ONE_SECOND   (MSEC_PER_SEC)

◆ ONE_SECOND_ALIGNED

#define ONE_SECOND_ALIGNED    (uint32_t)(k_ticks_to_ms_floor64(k_ms_to_ticks_ceil32(ONE_SECOND) + _TICK_ALIGN))

◆ TEST_THREAD_PRIORITY

#define TEST_THREAD_PRIORITY   -4

◆ THREAD_STACK

#define THREAD_STACK   (384 + CONFIG_TEST_EXTRA_STACKSIZE)

◆ TICK_MARGIN

#define TICK_MARGIN   1

Function Documentation

◆ align_to_tick_boundary()

static void align_to_tick_boundary ( void  )
static

◆ forever_thread_entry()

static void forever_thread_entry ( void p1,
void p2,
void p3 
)
static

◆ helper_thread()

static void helper_thread ( int  arg1,
int  arg2 
)
static

◆ irq_offload_isr()

static void irq_offload_isr ( const void arg)
static

◆ K_THREAD_STACK_DEFINE() [1/2]

static K_THREAD_STACK_DEFINE ( helper_thread_stack  ,
(384+CONFIG_TEST_EXTRA_STACKSIZE)   
)
static

◆ K_THREAD_STACK_DEFINE() [2/2]

static K_THREAD_STACK_DEFINE ( test_thread_stack  ,
(384+CONFIG_TEST_EXTRA_STACKSIZE)   
)
static

◆ sleep_time_valid()

static int sleep_time_valid ( uint32_t  start,
uint32_t  end,
uint32_t  dur 
)
static

◆ test_main()

void test_main ( void  )

test case main entry

◆ test_objects_init()

static void test_objects_init ( void  )
static

◆ test_sleep_forever()

void test_sleep_forever ( void  )

◆ test_thread()

static void test_thread ( int  arg1,
int  arg2 
)
static

◆ test_usleep()

void test_usleep ( void  )

Variable Documentation

◆ helper_thread_data

struct k_thread helper_thread_data
static

◆ helper_thread_id

k_tid_t helper_thread_id
static

◆ helper_thread_sem

struct k_sem helper_thread_sem
static

◆ task_sem

struct k_sem task_sem
static

◆ test_failure

bool test_failure = true
static

◆ test_thread_data

struct k_thread test_thread_data
static

◆ test_thread_id

k_tid_t test_thread_id
static

◆ test_thread_sem

struct k_sem test_thread_sem
static