Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
pi.c File Reference
#include <ztest.h>
#include "float_context.h"
#include "test_common.h"

Functions

static K_SEM_DEFINE (test_exit_sem, 0, 1)
 
static void calculate_pi_low (void)
 Entry point for the low priority pi compute task. More...
 
static void calculate_pi_high (void)
 Entry point for the high priority pi compute task. More...
 
 K_THREAD_DEFINE (pi_low,(1024+CONFIG_TEST_EXTRA_STACKSIZE), calculate_pi_low, NULL, NULL, NULL, 10,(K_FP_REGS), K_TICKS_FOREVER)
 
 K_THREAD_DEFINE (pi_high,(1024+CONFIG_TEST_EXTRA_STACKSIZE), calculate_pi_high, NULL, NULL, NULL, 5,(K_FP_REGS), K_TICKS_FOREVER)
 
void test_pi (void)
 

Variables

static float reference_pi = 0.0f
 
static volatile unsigned int calc_pi_low_count
 
static volatile unsigned int calc_pi_high_count
 
static volatile bool test_exited
 

Function Documentation

◆ calculate_pi_high()

static void calculate_pi_high ( void  )
static

Entry point for the high priority pi compute task.

◆ calculate_pi_low()

static void calculate_pi_low ( void  )
static

Entry point for the low priority pi compute task.

◆ K_SEM_DEFINE()

static K_SEM_DEFINE ( test_exit_sem  ,
,
 
)
static

◆ K_THREAD_DEFINE() [1/2]

K_THREAD_DEFINE ( pi_high  ,
(1024+CONFIG_TEST_EXTRA_STACKSIZE)  ,
calculate_pi_high  ,
NULL  ,
NULL  ,
NULL  ,
,
(K_FP_REGS ,
K_TICKS_FOREVER   
)

◆ K_THREAD_DEFINE() [2/2]

K_THREAD_DEFINE ( pi_low  ,
(1024+CONFIG_TEST_EXTRA_STACKSIZE)  ,
calculate_pi_low  ,
NULL  ,
NULL  ,
NULL  ,
10  ,
(K_FP_REGS ,
K_TICKS_FOREVER   
)

◆ test_pi()

void test_pi ( void  )

Variable Documentation

◆ calc_pi_high_count

volatile unsigned int calc_pi_high_count
static

◆ calc_pi_low_count

volatile unsigned int calc_pi_low_count
static

◆ reference_pi

float reference_pi = 0.0f
static

◆ test_exited

volatile bool test_exited
static