diff --git a/display.c b/display.c --- a/display.c +++ b/display.c @@ -5,6 +5,7 @@ #include "config.h" #include "states.h" #include "bootlib.h" +#include "flash.h" #include "gpio.h" uint8_t goto_mode = 2; @@ -85,13 +86,21 @@ void display_process(therm_settings_t* s case 0: { + ssd1306_DrawString("-> loader ", 1, 40); + } break; + + case 3: + { ssd1306_DrawString("-> reset ", 1, 40); - } break; + } } // Button handler if(SW_BTN_PRESSED) { switch(goto_mode) { + case 3: + status->state = STATE_IDLE; + flash_erase(set); case 2: status->state = STATE_PREHEAT_BREW; break; @@ -112,7 +121,7 @@ void display_process(therm_settings_t* s status->state = STATE_PREHEAT_BREW; } } - else if(SW_UP_PRESSED && goto_mode < 2) { + else if(SW_UP_PRESSED && goto_mode < 3) { goto_mode++; } else if(SW_DOWN_PRESSED && goto_mode > 0) { @@ -363,7 +372,7 @@ void display_process(therm_settings_t* s // Button handler if(SW_BTN_PRESSED) { - save_settings(&set); + flash_save(&set); status->state = STATE_IDLE; } else {