diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -11,7 +11,6 @@ #include "flash.h" #include "stringhelpers.h" #include "display.h" -#include "storage.h" #include "usb_device.h" #include "usbd_cdc_if.h" @@ -72,9 +71,6 @@ int main(void) status.setpoint = 70; status.pid_enabled = 0; - // Load settings (if any) from EEPROM - restore_settings(&set); - // Go to brew instead of idle if configured thusly if(set.val.boottobrew) status.state = STATE_PREHEAT_BREW; @@ -85,6 +81,7 @@ int main(void) HAL_Delay(1000); + // Restore settings from flash memory flash_restore(&set); HAL_Delay(1000); @@ -143,14 +140,13 @@ int main(void) // Every 200ms, set the SSR on unless output is 0 if(HAL_GetTick() - last_ssr_on > SSR_PERIOD) { + // Only support heating (ssr_output > 0) right now + if(ssr_output > 0) + { + char tempstr[6]; + itoa(ssr_output, tempstr, 10); + ssd1306_DrawString(tempstr, 0, 90); - char tempstr[6]; - itoa(ssr_output, tempstr, 10); - ssd1306_DrawString(tempstr, 0, 90); - - - // Only support heating (ssr_output > 0) right now - if(ssr_output > 0) { HAL_GPIO_WritePin(SSR_PIN, 1); HAL_GPIO_WritePin(LED_POWER, 1); last_ssr_on = HAL_GetTick(); @@ -163,7 +159,7 @@ int main(void) } - + // Transmit temperature over USB-CDC on a regulat basis if(HAL_GetTick() - last_vcp_tx > VCP_TX_FREQ) { // Print temp to cdc