diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -5,6 +5,7 @@ #include "ssd1306.h" #include "gpio.h" #include "spi.h" +#include "flash.h" #include "stringhelpers.h" #include "display.h" #include "storage.h" @@ -52,6 +53,9 @@ int main(void) HAL_Delay(1000); HAL_GPIO_WritePin(LED_POWER, 1); + if(!HAL_GPIO_ReadPin(SW_UP)) + bootloader_enter(); // Resets into bootloader + // TODO: Awesome pwm of power LED // Configure 1ms SysTick (change if more temporal resolution needed) @@ -97,6 +101,10 @@ int main(void) ssd1306_DrawString("protofusion.org/therm", 3, 0); HAL_Delay(1500); + + flash_init(&set); + + HAL_Delay(1500); ssd1306_clearscreen(); // Main loop