From 6f00ffb0f016413522bd54dc9e44beb92864df02 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 17 Dec 2023 15:11:10 +0100 Subject: Keep temperature valid for 15 minutes --- src/common/Core/fsm.c | 10 ++++++---- src/common/Core/main.c | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/common/Core') diff --git a/src/common/Core/fsm.c b/src/common/Core/fsm.c index 52ec8cb..47c349d 100644 --- a/src/common/Core/fsm.c +++ b/src/common/Core/fsm.c @@ -520,10 +520,11 @@ void fsm_update() { " %d AH %c ", capacity_bat_ah, supply_trend); } - if (temperature_valid()) { + float temp = 0; + if (temperature_get(&temp)) { len += snprintf(balise_message + len, BALISE_MESSAGE_LEN-len-1, " T %d ", - (int)(round_float_to_half_steps(temperature_get()))); + (int)(round_float_to_half_steps(temp))); } snprintf(balise_message + len, BALISE_MESSAGE_LEN-len-1, @@ -639,10 +640,11 @@ void fsm_update() { " %d AH ", capacity_bat_ah); } - if (temperature_valid()) { + float temp = 0; + if (temperature_get(&temp)) { len += snprintf(balise_message + len, BALISE_MESSAGE_LEN-len-1, " T %d ", - (int)(round_float_to_half_steps(temperature_get()))); + (int)(round_float_to_half_steps(temp))); } len += snprintf(balise_message+len, BALISE_MESSAGE_LEN-len-1, diff --git a/src/common/Core/main.c b/src/common/Core/main.c index ea393ab..f525221 100644 --- a/src/common/Core/main.c +++ b/src/common/Core/main.c @@ -502,8 +502,8 @@ static void gps_monit_task(void __attribute__ ((unused))*pvParameters) { stats_battery_at_full_hour(time.tm_hour, u_bat, capacity_bat); } - if (temperature_valid()) { - float temp = temperature_get(); + float temp = 0; + if (temperature_get(&temp)) { stats_temp(temp); const char *sign = ""; -- cgit v1.2.3