Skip to content

Commit

Permalink
Implement setup opening, water pumping, and closing states
Browse files Browse the repository at this point in the history
  • Loading branch information
acodili-jg committed May 13, 2024
1 parent 9e80dd5 commit 4162b19
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,28 @@ impl Sketch {
self.separator_hatch_enable.set_high();
}

State::SetupSeparatorOpening if delta_ms < duration::SEPARATOR_TRANSITION => {}
State::SetupSeparatorOpening => {
transition_to!(SetupWaterPumping);
self.separator_hatch_enable.set_low();
self.water_pump.set_high();
}

State::SetupWaterPumping if delta_ms < duration::SOAK_WATER_PUMPING => {}
State::SetupWaterPumping => {
transition_to!(SetupSeparatorClosing);
self.water_pump.set_low();
self.separator_hatch_direction.set_high();
self.separator_hatch_enable.set_high();
}

State::SetupSeparatorClosing if delta_ms < duration::SEPARATOR_TRANSITION => {}
State::SetupSeparatorClosing => {
transition_to!(Idling);
self.separator_hatch_enable.set_low();
self.ready.set_high();
}

_ => { /* TODO */ }
}
}
Expand Down

0 comments on commit 4162b19

Please sign in to comment.