diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-12-17 15:11:10 +0100 |
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-12-17 15:13:47 +0100 |
| commit | 6f00ffb0f016413522bd54dc9e44beb92864df02 (patch) | |
| tree | 7fc919bbfd84cd6da35d1e36ae22fa85d3b9729b /src/common/Core | |
| parent | 7f46a3879c9c76aa817cc27fb39718b8dd813f96 (diff) | |
| download | glutte-o-matic-6f00ffb0f016413522bd54dc9e44beb92864df02.tar.gz glutte-o-matic-6f00ffb0f016413522bd54dc9e44beb92864df02.tar.bz2 glutte-o-matic-6f00ffb0f016413522bd54dc9e44beb92864df02.zip | |
Keep temperature valid for 15 minutes
Diffstat (limited to 'src/common/Core')
| -rw-r--r-- | src/common/Core/fsm.c | 10 | ||||
| -rw-r--r-- | src/common/Core/main.c | 4 |
2 files changed, 8 insertions, 6 deletions
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 = ""; |
