From 242c4545805e0fdace318be77caa74cea6733e49 Mon Sep 17 00:00:00 2001 From: ryescholin <46325761+ryescholin@users.noreply.github.com> Date: Mon, 27 May 2024 00:30:49 -0700 Subject: [PATCH] Incorporate high-voltage system with FSM (#79) add in hvs --- pod-operation/src/state_machine.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pod-operation/src/state_machine.rs b/pod-operation/src/state_machine.rs index 643a1b5d..8c0c3a72 100644 --- a/pod-operation/src/state_machine.rs +++ b/pod-operation/src/state_machine.rs @@ -8,6 +8,7 @@ use tokio::sync::Mutex; use tracing::info; use crate::components::brakes::Brakes; +use crate::components::high_voltage_system::HighVoltageSystem; use crate::components::lim_temperature::LimTemperature; use crate::components::pressure_transducer::PressureTransducer; use crate::components::signal_light::SignalLight; @@ -43,6 +44,7 @@ pub struct StateMachine { downstream_pressure_transducer: PressureTransducer, lim_temperature_port: LimTemperature, lim_temperature_starboard: LimTemperature, + high_voltage_system: HighVoltageSystem, } impl StateMachine { @@ -96,6 +98,7 @@ impl StateMachine { lim_temperature_starboard: LimTemperature::new(ads1x1x::SlaveAddr::Alternative( false, true, )), + high_voltage_system: HighVoltageSystem::new(), } } @@ -166,6 +169,7 @@ impl StateMachine { fn _enter_running(&mut self) { info!("Entering Running state"); + self.high_voltage_system.enable(); // Enable high voltage system -- may move later self.signal_light.enable(); self.brakes.disengage(); } @@ -178,9 +182,9 @@ impl StateMachine { fn _enter_halted(&mut self) { info!("Entering Halted state"); - // self.hvs.disable() self.signal_light.disable(); self.brakes.engage(); + self.high_voltage_system.disable(); } /// Perform operations when the pod is loading