From 67f9e65df8569b9ab31840d7793f0c64328687c2 Mon Sep 17 00:00:00 2001 From: linuswck Date: Wed, 20 Mar 2024 14:31:29 +0800 Subject: [PATCH] Start tec_readings_conversion after report is sent - Before this fix, tec_readings only converts when eth_is_pending --- src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 820beeb..c8d0109 100644 --- a/src/main.rs +++ b/src/main.rs @@ -133,12 +133,10 @@ fn main() -> ! { } State::MainLoop => { let mut eth_is_pending = false; - let mut has_temp_reading = false; laser.poll_and_update_output_current(); if thermostat.poll_adc() { - has_temp_reading = true; thermostat.update_pid(); if thermostat.get_temp_mon_status().over_temp_alarm { laser.power_down(); @@ -158,6 +156,8 @@ fn main() -> ! { active_report[id] = false; } }); + + thermostat.start_tec_readings_conversion(); } cortex_m::interrupt::free(|cs| { @@ -178,9 +178,6 @@ fn main() -> ! { } } } - if has_temp_reading { - thermostat.start_tec_readings_conversion(); - } }) }; }