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

Macros

#define THREAD_STACK   (384 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define TEST_TICKS_TO_SLEEP   (CONFIG_SYS_CLOCK_TICKS_PER_SEC / 2)
 

Functions

static K_THREAD_STACK_DEFINE (helper_tstack,(384+CONFIG_TEST_EXTRA_STACKSIZE))
 
static void helper_thread (void *p1, void *p2, void *p3)
 
static int ticks_to_sleep (int ticks)
 
static int test_early_sleep_post_kernel (const struct device *unused)
 
 SYS_INIT (test_early_sleep_post_kernel, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE)
 
static int test_early_sleep_app (const struct device *unused)
 
 SYS_INIT (test_early_sleep_app, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE)
 
static void test_early_sleep (void)
 Test early sleep. More...
 
void test_main (void)
 

Variables

static struct k_thread helper_tdata
 
static k_tid_t helper_ttid
 
static int actual_sleep_ticks
 
static int actual_post_kernel_sleep_ticks
 
static int actual_app_sleep_ticks
 
static bool test_failure = true
 

Macro Definition Documentation

◆ TEST_TICKS_TO_SLEEP

#define TEST_TICKS_TO_SLEEP   (CONFIG_SYS_CLOCK_TICKS_PER_SEC / 2)

◆ THREAD_STACK

#define THREAD_STACK   (384 + CONFIG_TEST_EXTRA_STACKSIZE)

Function Documentation

◆ helper_thread()

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

◆ K_THREAD_STACK_DEFINE()

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

◆ SYS_INIT() [1/2]

SYS_INIT ( test_early_sleep_app  ,
APPLICATION  ,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE   
)

◆ SYS_INIT() [2/2]

SYS_INIT ( test_early_sleep_post_kernel  ,
POST_KERNEL  ,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE   
)

◆ test_early_sleep()

static void test_early_sleep ( void  )
static

Test early sleep.

See also
k_sleep()

◆ test_early_sleep_app()

static int test_early_sleep_app ( const struct device unused)
static

◆ test_early_sleep_post_kernel()

static int test_early_sleep_post_kernel ( const struct device unused)
static

◆ test_main()

void test_main ( void  )

◆ ticks_to_sleep()

static int ticks_to_sleep ( int  ticks)
static

Variable Documentation

◆ actual_app_sleep_ticks

int actual_app_sleep_ticks
static

◆ actual_post_kernel_sleep_ticks

int actual_post_kernel_sleep_ticks
static

◆ actual_sleep_ticks

int actual_sleep_ticks
static

◆ helper_tdata

struct k_thread helper_tdata
static

◆ helper_ttid

k_tid_t helper_ttid
static

◆ test_failure

bool test_failure = true
static