From 32ccd29c5c35579dd16d9c1ecf9e3e5e4d3de732 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Sat, 21 Nov 2020 11:02:49 +0100 Subject: [PATCH] State: Add sane initialization --- openrtx/src/state.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/openrtx/src/state.c b/openrtx/src/state.c index cfbab9d5..8708ea59 100644 --- a/openrtx/src/state.c +++ b/openrtx/src/state.c @@ -21,8 +21,20 @@ #include #include -state_t state; -modified_t state_flags; +const curTime_t epoch = {0, 0, 0, 1, 1, 1970}; + +state_t state = { + epoch, //time + 0.0, //v_bat + 0.0, //rx_freq + 0.0 //tx_freq +}; + +modified_t state_flags = { + false, //ui_modified + false, //rtx_modified + false //self_modified +}; void state_init() {