1
0
Fork 0

Start tec_readings_conversion after report is sent

- Before this fix, tec_readings only converts when eth_is_pending
This commit is contained in:
linuswck 2024-03-20 14:31:29 +08:00
parent 7d2e14ef2f
commit 67f9e65df8
1 changed files with 2 additions and 5 deletions

View File

@ -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();
}
})
};
}