diff --git a/pod-operation/src/components/lim_temperature.rs b/pod-operation/src/components/lim_temperature.rs index 5e070e12..ade303c3 100644 --- a/pod-operation/src/components/lim_temperature.rs +++ b/pod-operation/src/components/lim_temperature.rs @@ -41,10 +41,9 @@ impl LimTemperature { self.ads1015.destroy_ads1015(); } - pub fn read_lim_temps(&mut self) -> (f32, f32, f32, f32) { + pub fn read_lim_temps(&mut self) -> [f32; 4] { [SingleA0, SingleA1, SingleA2, SingleA3] .map(|channel| block!(self.ads1015.read(channel)).unwrap()) .map(voltage_to_temp) - .into() } } diff --git a/pod-operation/src/state_machine.rs b/pod-operation/src/state_machine.rs index 9ab633be..c82e1020 100644 --- a/pod-operation/src/state_machine.rs +++ b/pod-operation/src/state_machine.rs @@ -219,11 +219,11 @@ impl StateMachine { if self.downstream_pressure_transducer.read_pressure() < MIN_PRESSURE { return State::Faulted; } - let default_readings: [f32; 4] = self.lim_temperature_port.read_lim_temps().into(); - let alternative_readings: [f32; 4] = self.lim_temperature_starboard.read_lim_temps().into(); - let all_readings = [default_readings, alternative_readings].concat(); - if all_readings + let default_readings = self.lim_temperature_port.read_lim_temps(); + let alternative_readings = self.lim_temperature_starboard.read_lim_temps(); + if default_readings .iter() + .chain(alternative_readings.iter()) .any(|&reading| reading > LIM_TEMP_THRESHOLD) { return State::Faulted;