ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
log_feed.c File Reference

Record builders (see log_feed.h). More...

#include "log_feed.h"
#include "log_queue.h"
#include "log_format.h"
#include <math.h>
#include <string.h>
Include dependency graph for log_feed.c:

Go to the source code of this file.

Functions

void logf_set_clock (uint32_t(*now_ms)(void))
 clock for the event records (ms)
 
static int16_t i16 (float v)
 
static uint16_t u16 (float v)
 
static int32_t i32 (float v)
 
static int8_t i8 (float v)
 
void logf_att (uint32_t t, const float q[4], const float w[3], const float a[3])
 
void logf_vert (uint32_t t, const fc_vert_t *v, const fc_setpoint_t *sp, uint16_t tof_mm, uint32_t baro_pa)
 
void logf_flight (uint32_t t, const fc_state_t *s)
 
void logf_est (uint32_t t, const float b[3], float unc, float vib, float hz, float jit, float cpu, float mi)
 
void logf_event (const fc_event_t *e)
 fc_config_t.on_event
 
void logf_power (uint32_t t, const batt_state_t *b)
 

Variables

static uint32_t(* s_clock )(void)
 

Detailed Description

Record builders (see log_feed.h).

Definition in file log_feed.c.

Function Documentation

◆ logf_set_clock()

void logf_set_clock ( uint32_t(*)(void)  now_ms)

clock for the event records (ms)

Definition at line 13 of file log_feed.c.

References s_clock.

Referenced by app_start().

Here is the caller graph for this function:

◆ i16()

static int16_t i16 ( float  v)
static

Definition at line 15 of file log_feed.c.

Referenced by logf_att(), logf_est(), logf_power(), and logf_vert().

Here is the caller graph for this function:

◆ u16()

static uint16_t u16 ( float  v)
static

Definition at line 16 of file log_feed.c.

Referenced by logf_est(), and logf_power().

Here is the caller graph for this function:

◆ i32()

static int32_t i32 ( float  v)
static

Definition at line 17 of file log_feed.c.

Referenced by logf_vert().

Here is the caller graph for this function:

◆ i8()

static int8_t i8 ( float  v)
static

Definition at line 18 of file log_feed.c.

Referenced by logf_flight().

Here is the caller graph for this function:

◆ logf_att()

void logf_att ( uint32_t  t,
const float  q[4],
const float  w[3],
const float  a[3] 
)

Definition at line 20 of file log_feed.c.

References log_att_t::acc, log_att_t::gyro, i16(), log_q_active(), log_q_put(), LOG_SRC_IMU, LR_ATT, log_att_t::q, and log_att_t::t_ms.

Referenced by log_records().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logf_vert()

void logf_vert ( uint32_t  t,
const fc_vert_t *  v,
const fc_setpoint_t *  sp,
uint16_t  tof_mm,
uint32_t  baro_pa 
)

Definition at line 30 of file log_feed.c.

References log_vert_t::baro_pa, log_vert_t::flags, fc_vert_t::flow_q, log_vert_t::flow_q, fc_vert_t::flow_usable, fc_vert_t::h, log_vert_t::h_mm, log_vert_t::h_sp_mm, i16(), i32(), log_q_active(), log_q_put(), LOG_SRC_IMU, LR_VERT, sp, log_vert_t::t_ms, log_vert_t::thrust, fc_vert_t::tof_ground, log_vert_t::tof_mm, fc_vert_t::tof_valid, fc_vert_t::valid, fc_vert_t::vz, log_vert_t::vz_mms, and log_vert_t::vz_sp_mms.

Referenced by log_records().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logf_flight()

void logf_flight ( uint32_t  t,
const fc_state_t *  s 
)

Definition at line 50 of file log_feed.c.

References log_flight_t::armed, log_flight_t::autom, log_flight_t::failsafe, log_flight_t::flags, i8(), log_q_active(), log_q_put(), LOG_SRC_IMU, LR_FLIGHT, log_flight_t::mode, s, log_flight_t::silence_ms, log_flight_t::stick, and log_flight_t::t_ms.

Referenced by log_records().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logf_est()

void logf_est ( uint32_t  t,
const float  b[3],
float  unc,
float  vib,
float  hz,
float  jit,
float  cpu,
float  mi 
)

Definition at line 63 of file log_feed.c.

References log_est_t::att_unc_cdeg, b, log_est_t::cpu_pct, log_est_t::gyro_bias, i16(), log_est_t::jitter_us, log_q_active(), log_q_put(), LOG_SRC_IMU, log_est_t::loop_hz, LR_EST, log_est_t::mag_interf_pct, log_est_t::t_ms, u16(), and log_est_t::vib_mg.

Referenced by log_records().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logf_event()

void logf_event ( const fc_event_t *  e)

fc_config_t.on_event

Definition at line 78 of file log_feed.c.

References fc_event_t::arg, log_event_t::arg, fc_event_t::code, log_event_t::code, fc_event_t::level, log_event_t::level, log_q_active(), log_q_put(), LOG_SRC_IMU, LR_EVENT, s_clock, and log_event_t::t_ms.

Referenced by app_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logf_power()

void logf_power ( uint32_t  t,
const batt_state_t *  b 
)

Definition at line 87 of file log_feed.c.

References b, log_power_t::cell_mv, log_power_t::cell_rest_mv, log_power_t::cells, log_power_t::current_ca, i16(), log_power_t::level, log_q_active(), log_q_put(), LOG_SRC_BATT, LR_POWER, log_power_t::pct, log_power_t::r_cell_mohm, log_power_t::t_ms, u16(), log_power_t::used_mah, and log_power_t::vbat_mv.

Referenced by batt_task_step().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_clock

uint32_t(* s_clock) (void) ( void  )
static

Definition at line 11 of file log_feed.c.

Referenced by logf_event(), and logf_set_clock().