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

Producers' side of the flight log: build a record from the values the task already has and queue it (log/log_queue.h). More...

#include <stdint.h>
#include "fc_core.h"
#include "battery.h"
Include dependency graph for log_feed.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void logf_set_clock (uint32_t(*now_ms)(void))
 clock for the event records (ms)
 
void logf_att (uint32_t t, const float q[4], const float gyro[3], const float acc_g[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 gyro_bias[3], float att_unc_deg, float vib_mg, float loop_hz, float jitter_us, float cpu_pct, float mag_interf_pct)
 
void logf_event (const fc_event_t *e)
 fc_config_t.on_event
 
void logf_power (uint32_t t, const batt_state_t *b)
 

Detailed Description

Producers' side of the flight log: build a record from the values the task already has and queue it (log/log_queue.h).

Every function returns at once when no log is open (log_q_active() = 0). ImuTask: logf_att, logf_vert, logf_flight, logf_est, logf_event (via the flight core's on_event hook). BattTask: logf_power. Host-testable.

Definition in file log_feed.h.

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:

◆ logf_att()

void logf_att ( uint32_t  t,
const float  q[4],
const float  gyro[3],
const float  acc_g[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  gyro_bias[3],
float  att_unc_deg,
float  vib_mg,
float  loop_hz,
float  jitter_us,
float  cpu_pct,
float  mag_interf_pct 
)

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: