33 #ifndef PREFLIGHT_CHECK_MAX_MSGBUF
34 #define PREFLIGHT_CHECK_MAX_MSGBUF 1024
38 #ifndef PREFLIGHT_CHECK_SEPERATOR
39 #define PREFLIGHT_CHECK_SEPERATOR ';'
43 #ifndef PREFLIGHT_CHECK_INFO_TIMEOUT
44 #define PREFLIGHT_CHECK_INFO_TIMEOUT 5
48 #ifndef PREFLIGHT_CHECK_GROUND
49 #define PREFLIGHT_CHECK_GROUND TRUE
53 #ifndef PREFLIGHT_CHECK_BYPASS
54 #define PREFLIGHT_CHECK_BYPASS FALSE
85 static float last_info_time = 0;
97 while (check != NULL) {
104 #if PREFLIGHT_CHECK_GROUND
119 rc = snprintf(result.
message, result.
max_len,
"*Preflight fail [fail:%d warn:%d tot:%d]*", result.
fail_cnt,
134 #if FLIGHTRECORDER_SDLOG
135 pprz_msg_send_INFO_MSG(&
pprzlog_tp.trans_tx, &flightrecorder_sdlog.device, AC_ID, i - last_sendi, &error_msg[last_sendi]);
157 #if FLIGHTRECORDER_SDLOG
158 pprz_msg_send_INFO_MSG(&
pprzlog_tp.trans_tx, &flightrecorder_sdlog.device, AC_ID, strlen(error_msg), error_msg);
264 char *
msg = (bypass)?
"*Preflight checks bypassed*" :
"*Preflight checks unbypassed*";
265 int len = strlen(
msg);
268 #if FLIGHTRECORDER_SDLOG
269 pprz_msg_send_INFO_MSG(&
pprzlog_tp.trans_tx, &flightrecorder_sdlog.device, AC_ID, len,
msg);
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
struct pprzlog_transport pprzlog_tp
PPRZLOG transport structure.
#define PREFLIGHT_CHECK_INFO_TIMEOUT
Only send messages down every xx amount of seconds.
#define PREFLIGHT_CHECK_BYPASS
Bypass the preflight checks.
void preflight_error(struct preflight_result_t *result, const char *fmt,...)
Register a preflight error used inside the preflight checking functions.
void preflight_success(struct preflight_result_t *result, const char *fmt,...)
Register a preflight success used inside the preflight checking functions.
bool preflight_ground_done
void preflight_checks_log_bypass(bool bypass)
static struct preflight_check_t * preflight_head
#define PREFLIGHT_CHECK_SEPERATOR
Seperating character for storing the errors.
void preflight_warning(struct preflight_result_t *result, const char *fmt,...)
Register a preflight warning used inside the preflight checking functions.
bool preflight_check(void)
Perform all the preflight checks.
void preflight_check_register(struct preflight_check_t *check, preflight_check_f func)
Register a preflight check and add it to the linked list.
#define PREFLIGHT_CHECK_MAX_MSGBUF
Maximum combined message size for storing the errors.
void(* preflight_check_f)(struct preflight_result_t *result)
struct preflight_check_t * next
static float get_sys_time_float(void)
Get the time in seconds since startup.
Periodic telemetry system header (includes downlink utility and generated code).
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.