STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_sensors_core.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fake_baro.h"
#include "fake_regs.h"
#include "sensors_core.h"
Include dependency graph for test_sensors_core.c:

Go to the source code of this file.

Classes

struct  sink_t
struct  rig_t

Macros

#define CHECK(c)
#define kWakeLatencyUs   37U /* a real task runs a little after its IRQ */

Functions

static void record (void *ctx, uint8_t type, const void *data, uint8_t len)
static void rig_init (rig_t *r, uint32_t start_us)
static int32_t diff (uint32_t a, uint32_t b)
static void run (rig_t *r, uint32_t until)
static void test_nominal_rates_values_and_timestamps (void)
static void test_highg_without_edges_is_read_on_timeout (void)
static void test_failing_imu_is_dropped_and_recovered (void)
static void test_wrong_chip_never_produces_and_keeps_retrying (void)
static void test_dead_baro_bus_is_reported (void)
static void test_stop_powers_down_and_init_restarts (void)
static void test_wait_never_overshoots_a_deadline (void)
static void test_clock_wrap_is_harmless (void)
int main (void)

Macro Definition Documentation

◆ CHECK

◆ kWakeLatencyUs

#define kWakeLatencyUs   37U /* a real task runs a little after its IRQ */

Definition at line 91 of file test_sensors_core.c.

Referenced by run().

Function Documentation

◆ diff()

◆ main()

◆ record()

void record ( void * ctx,
uint8_t type,
const void * data,
uint8_t len )
static

◆ rig_init()

◆ run()

◆ test_clock_wrap_is_harmless()

void test_clock_wrap_is_harmless ( void )
static

Definition at line 237 of file test_sensors_core.c.

References CHECK, r, and rig_init().

Referenced by main().

◆ test_dead_baro_bus_is_reported()

void test_dead_baro_bus_is_reported ( void )
static

Definition at line 198 of file test_sensors_core.c.

References CHECK, DEV_ERR_BUS, r, and rig_init().

Referenced by main().

◆ test_failing_imu_is_dropped_and_recovered()

void test_failing_imu_is_dropped_and_recovered ( void )
static

Definition at line 164 of file test_sensors_core.c.

References CHECK, DEV_ERR_BUS, r, rig_init(), SENSORS_MAX_ERRORS, and SENSORS_RETRY_US.

Referenced by main().

◆ test_highg_without_edges_is_read_on_timeout()

void test_highg_without_edges_is_read_on_timeout ( void )
static

Definition at line 153 of file test_sensors_core.c.

References CHECK, r, and rig_init().

Referenced by main().

◆ test_nominal_rates_values_and_timestamps()

void test_nominal_rates_values_and_timestamps ( void )
static

Definition at line 131 of file test_sensors_core.c.

References CHECK, r, and rig_init().

Referenced by main().

◆ test_stop_powers_down_and_init_restarts()

void test_stop_powers_down_and_init_restarts ( void )
static

◆ test_wait_never_overshoots_a_deadline()

void test_wait_never_overshoots_a_deadline ( void )
static

Definition at line 229 of file test_sensors_core.c.

References CHECK, r, rig_init(), SENSORS_BARO_STEP_US, sensors_core_wait_us(), and SENSORS_IMU_PERIOD_US.

Referenced by main().

◆ test_wrong_chip_never_produces_and_keeps_retrying()

void test_wrong_chip_never_produces_and_keeps_retrying ( void )
static

Definition at line 185 of file test_sensors_core.c.

References CHECK, DEV_ERR_ID, r, rig_init(), and SENSORS_RETRY_US.

Referenced by main().