Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pi.c File Reference
#include <zephyr/ztest.h>
#include "float_context.h"
#include "test_common.h"

Macros

#define FP_TYPE   float
 
#define FP_CONSTANT(x)   x##f
 

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.
 
static void calculate_pi_high (void)
 Entry point for the high priority pi compute task.
 
 K_THREAD_DEFINE (pi_low,(1024+CONFIG_TEST_EXTRA_STACK_SIZE), calculate_pi_low, NULL, NULL, NULL, 10,(K_FP_REGS), K_TICKS_FOREVER)
 
 K_THREAD_DEFINE (pi_high,(1024+CONFIG_TEST_EXTRA_STACK_SIZE), calculate_pi_high, NULL, NULL, NULL, 5,(K_FP_REGS), K_TICKS_FOREVER)
 
 ZTEST (fpu_sharing_generic, test_pi)
 

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
 

Macro Definition Documentation

◆ FP_CONSTANT

#define FP_CONSTANT (   x)    x##f

◆ FP_TYPE

#define FP_TYPE   float

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_STACK_SIZE)  ,
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_STACK_SIZE)  ,
calculate_pi_low  ,
NULL  ,
NULL  ,
NULL  ,
10  ,
(K_FP_REGS ,
K_TICKS_FOREVER   
)

◆ ZTEST()

ZTEST ( fpu_sharing_generic  ,
test_pi   
)

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