From 3c0ed806b4ce9a234ec11f24694998f845e95f6e Mon Sep 17 00:00:00 2001 From: "Jack Gabriel C. Acodili" <112671361+acodili-jg@users.noreply.github.com> Date: Sat, 11 May 2024 21:53:10 +0800 Subject: [PATCH] Implement heated mixing state --- src/duration.rs | 3 ++- src/sketch.rs | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/duration.rs b/src/duration.rs index 8c40855..9aeee06 100644 --- a/src/duration.rs +++ b/src/duration.rs @@ -9,9 +9,10 @@ macro_rules! constants { constants! { DEFAULT_LONG = Millis(5000); DEFAULT = Millis(2000); - DEFAULT_SHORT = Millis(250); + DEFAULT_SHORT = Millis(500); DRAINING = DEFAULT_LONG; + HEATED_MIXING = DEFAULT; HEATING = DEFAULT_LONG; LOCKING = DEFAULT_SHORT; SEPARATOR_TRANSITION = DEFAULT; diff --git a/src/sketch.rs b/src/sketch.rs index b0b0a17..b095b38 100644 --- a/src/sketch.rs +++ b/src/sketch.rs @@ -155,6 +155,18 @@ impl Sketch { self.mixer.set_high(); } + State::SoakWaterHeatedMixing if stop => { + transition_to!(SoakWaterDraining); + self.heater.set_low(); + self.mixer.set_low(); + self.upper_drain_pump.set_high(); + } + State::SoakWaterHeatedMixing if delta_ms < duration::HEATED_MIXING => {} + State::SoakWaterHeatedMixing => { + transition_to!(SoakWaterMixing); + self.heater.set_low(); + } + _ => { /* TODO */ } } }