From afd5583970e5363aafb7eed1f289f45608a3162c Mon Sep 17 00:00:00 2001 From: "Jack Gabriel C. Acodili" <112671361+acodili-jg@users.noreply.github.com> Date: Sat, 11 May 2024 22:35:23 +0800 Subject: [PATCH] Implement rinsing state --- src/duration.rs | 1 + src/sketch.rs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/duration.rs b/src/duration.rs index b24bc90..34ebe0a 100644 --- a/src/duration.rs +++ b/src/duration.rs @@ -16,6 +16,7 @@ constants! { HEATING = DEFAULT_LONG; LOCKING = DEFAULT_SHORT; MIXING = DEFAULT_LONG; + RINSING = DEFAULT_LONG; SEPARATOR_TRANSITION = DEFAULT; SOAK_WATER_PUMPING = DEFAULT_LONG; } diff --git a/src/sketch.rs b/src/sketch.rs index f5134e0..b79c728 100644 --- a/src/sketch.rs +++ b/src/sketch.rs @@ -186,10 +186,15 @@ impl Sketch { } State::SoakWaterDraining => { transition_to!(RinseWaterPumping); - self.upper_drain_pump.set_low(); self.water_pump.set_high(); } + State::RinseWaterPumping if delta_ms < duration::RINSING => {} + State::RinseWaterPumping => { + transition_to!(RinseWaterDraining); + self.water_pump.set_low(); + } + _ => { /* TODO */ } } }