diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -45,6 +45,7 @@ enum state { STATE_MAINTAIN_STEAM, }; +uint8_t state = STATE_IDLE; static __IO uint32_t TimingDelay; @@ -93,10 +94,10 @@ int main(void) ssd1306_DrawString("protofusion.org/therm", 3, 0); delay(1500); ssd1306_clearscreen(); + restore_settings(); - delay(1500); - delay(1500); - ssd1306_clearscreen(); + if(boottobrew) + state = STATE_PREHEAT_BREW; // Go to brew instead of idle if configured thusly GPIO_ResetBits(LED_STAT); @@ -277,7 +278,6 @@ void draw_setpoint() { ssd1306_DrawString(tempstr, 3, 95); } -uint8_t state = STATE_IDLE; uint8_t goto_mode = 2; // State machine @@ -320,6 +320,7 @@ void save_settings() } +// TODO: Save/restore temperature setpoint settings void restore_settings() { DATA_EEPROM_Unlock(); @@ -339,12 +340,6 @@ void restore_settings() k_d = (*(__IO uint32_t*)EEPROM_ADDR_K_D); DATA_EEPROM_Lock(); - - char tempstr[6]; - itoa(windup_guard, tempstr); - ssd1306_DrawString("Read: ", 3, 40); - ssd1306_DrawString(" ", 3, 72); - ssd1306_DrawString(tempstr, 3, 72); } void machine()