Commit d81e6943 authored by Philippe Kalaf's avatar Philippe Kalaf

Added steam mode

parent 3e83dfe9
......@@ -97,8 +97,8 @@ void BrewControl::set_shot_temperature(float shot_temp)
{
if (shot_temp <= 20)
_target_shot_temperature = 20;
else if (shot_temp >= 110)
_target_shot_temperature = 110;
else if (shot_temp >= 150)
_target_shot_temperature = 150;
else
_target_shot_temperature = shot_temp;
}
......
......@@ -108,23 +108,26 @@ BrewControl brew_control(p10, p15, p12, p13, p20, p25, p26);
#define M_BREW_YIELD 2
#define M_BREW_TIME_YIELD 3
#define M_BREW_MANUAL 4
#define M_BREW_STEAM 5
// brew menus - 1 because we start at 0
#define NUM_BREW_MENUS 4
#define NUM_BREW_MENUS 6
const char* MENU_TITLES[5]= {
const char* MENU_TITLES[NUM_BREW_MENUS]= {
"Brew Settings",
"Brew Set Time",
"Brew Set Yield",
"Brew Set Time/Yield",
"Manual Brew"
"Manual Brew",
"Steam"
};
const uint8_t MENU_ITEMS[NUM_BREW_MENUS][5]= {
{1, 3, TEMPERATURE, PRE_INFUSE_TIME, PRESSURE},
{1, 1, SHOT_TIME, EMPTY, EMPTY},
{1, 1, YIELD, EMPTY, EMPTY},
{1, 2, YIELD, SHOT_TIME, EMPTY}
{1, 2, YIELD, SHOT_TIME, EMPTY},
{1, 0, EMPTY, EMPTY, EMPTY}, // stub for manual brew (no sub menu)
{1, 0, EMPTY, EMPTY, EMPTY} // stub for steam (no sub menu)
};
const char* ITEM_STRINGS[7]= {
......@@ -141,7 +144,9 @@ uint8_t brew_params[NUM_BREW_MENUS][3][3]= {
{ {92, 3, 9}, {0, 0, 0}, {0, 0, 0} },
{ {28, 0, 0}, {0, 0, 0}, {0, 0, 0} },
{ {55, 0, 0}, {0, 0, 0}, {0, 0, 0} },
{ {55, 28, 0}, {55, 28, 0}, {55, 28, 0} }
{ {55, 28, 0}, {55, 28, 0}, {55, 28, 0} },
{ {0, 0, 0}, {0, 0, 0}, {0, 0, 0} }, // stub for manual brew (no sub menu)
{ {0, 0, 0}, {0, 0, 0}, {0, 0, 0} } // stub for steam (no sub menu)
};
uint8_t active_menu = 0;
......@@ -234,6 +239,11 @@ void draw_menu()
LCD.locate(2,16);
LCD.printf("FLOWRATE");
}
else if (active_menu == M_BREW_STEAM)
{
LCD.locate(4,16);
LCD.printf("STEAM");
}
if (state == BREWING)
{
LCD.locate(5,23);
......@@ -378,6 +388,13 @@ void menu_handler()
case L_BREW: if(active_menu == M_BREW_MANUAL)
// skip sub-menu for manual mode
menu_level = L_MENU;
else if(active_menu == M_BREW_STEAM)
{
// Put temperature back to previous setting when leaving steam mode
// TODO flow some water to cool things down faster?
brew_control.set_shot_temperature(brew_params[0][0][0]);
menu_level = L_MENU;
}
else
menu_level = L_MENU_SUB;
break;
......@@ -407,6 +424,11 @@ void menu_handler()
case L_MENU: if(active_menu == M_BREW_MANUAL)
// skip sub-menu for manual mode
menu_level = L_BREW;
else if(active_menu == M_BREW_STEAM)
{
menu_level = L_BREW;
brew_control.set_shot_temperature(140);
}
else
menu_level = L_MENU_SUB;
break;
......@@ -429,7 +451,7 @@ void menu_handler()
switch (menu_level)
{
case L_STANDBY: menu_level = L_MENU; break;
case L_MENU: active_menu = (active_menu < NUM_BREW_MENUS)?active_menu+1:active_menu;
case L_MENU: active_menu = (active_menu < NUM_BREW_MENUS-1)?active_menu+1:active_menu;
break;
case L_MENU_SUB: if(edit_mode < (MENU_ITEMS[active_menu][1]-1)*3
&& edit_mode > 0)
......
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