Skip to content

Commit

Permalink
Incorporate high-voltage system with FSM (#79)
Browse files Browse the repository at this point in the history
add in hvs
  • Loading branch information
ryescholin authored May 27, 2024
1 parent 36cf6a6 commit 242c454
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pod-operation/src/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -96,6 +98,7 @@ impl StateMachine {
lim_temperature_starboard: LimTemperature::new(ads1x1x::SlaveAddr::Alternative(
false, true,
)),
high_voltage_system: HighVoltageSystem::new(),
}
}

Expand Down Expand Up @@ -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();
}
Expand All @@ -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
Expand Down

0 comments on commit 242c454

Please sign in to comment.