Commit 8546a603 authored by Philippe Kalaf's avatar Philippe Kalaf

Manual pre-infuse stop

parent b1b28ebd
......@@ -199,6 +199,11 @@ int BrewControl::get_preinfuse_time()
return _preinfuse_time;
}
void BrewControl::stop_preinfuse_now()
{
_stop_preinfuse = 1;
}
uint8_t BrewControl::get_pump_level()
{
return _pump_control.get_level();
......@@ -254,7 +259,7 @@ void BrewControl::brew_worker()
if (_mode == MODE_PRE_INFUSE)
{
// First let's fill up the portafilter
if (_flow_sensor.read() <= PORTAFILTER_VOLUME)
if (_flow_sensor.read() <= PORTAFILTER_VOLUME && !_stop_preinfuse)
return;
// It's full, let's stop the pump for set pre-infuse time
......@@ -272,6 +277,7 @@ void BrewControl::brew_worker()
_shot_clock = 0;
_flow_sensor.reset_count();
_state = BREWING;
_stop_preinfuse = 0;
}
}
else if(_mode == MODE_TIME)
......
......@@ -38,8 +38,7 @@
#define PRE_INFUSING 2
#define SOFT_STOPPING 3
#define PORTAFILTER_VOLUME 30
#define PORTAFILTER_VOLUME 100
/// This is the main class where all brew functions and sensors are handled
class BrewControl
......@@ -75,6 +74,8 @@ public:
void set_preinfuse_time(int time);
/// Get the current set pre-infuse time in s, 0 if no pre-infuse is set
int get_preinfuse_time();
/// Function call to manually set pre-infuse quantity
void stop_preinfuse_now();
/// Set the target shot volume in ml (default 60ml)
void set_shot_volume(int volume);
......@@ -168,6 +169,9 @@ private:
int _prev_mode;
int _prev_pressure;
int _preinfuse_time;
// This is for manual pre-infuse control
bool _stop_preinfuse;
// Workers
Ticker _brew_ticker;
......
......@@ -410,7 +410,9 @@ void menu_handler()
[conversion_table[edit_mode-1][0]]
[conversion_table[edit_mode-1][1]]++;
break;
case L_BREW: break;
case L_BREW: if(brew_control.get_state() == PRE_INFUSING)
brew_control.stop_preinfuse_now();
break;
}
}
// down
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment