# HG changeset patch # User Ethan Zonca # Date 2015-06-15 21:11:56 # Node ID f1a2d85da29bd16ff7b35dcc3e5fa1db3c323d02 # Parent 3dc8ab4e292865f3f58ec72747c7a788ad67f707 Bootloader is now the top menu item, and menu defaults to second item. System resets on flash erase. diff --git a/display.c b/display.c --- a/display.c +++ b/display.c @@ -74,6 +74,11 @@ void display_process(therm_settings_t* s ssd1306_drawlogo(); switch(goto_mode) { + case 3: + { + ssd1306_DrawString("-> loader ", 1, 40); + } break; + case 2: { ssd1306_DrawString("-> heat ", 1, 40); @@ -86,11 +91,6 @@ void display_process(therm_settings_t* s case 0: { - ssd1306_DrawString("-> loader ", 1, 40); - } break; - - case 3: - { ssd1306_DrawString("-> reset ", 1, 40); } } @@ -99,15 +99,6 @@ void display_process(therm_settings_t* s if(SW_BTN_PRESSED) { switch(goto_mode) { case 3: - status->state = STATE_IDLE; - flash_erase(set); - case 2: - status->state = STATE_PREHEAT_BREW; - break; - case 1: - status->state = STATE_SETP; - break; - case 0: { ssd1306_clearscreen(); ssd1306_DrawString("Bootloader Entered", 0, 0); @@ -116,6 +107,17 @@ void display_process(therm_settings_t* s bootloader_enter(); // Resets into bootloader status->state = STATE_IDLE; // Just in case } break; + case 2: + status->state = STATE_PREHEAT_BREW; + break; + case 1: + status->state = STATE_SETP; + break; + case 0: + status->state = STATE_IDLE; + flash_erase(set); + NVIC_SystemReset(); + break; default: status->state = STATE_PREHEAT_BREW;