diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -65,7 +65,10 @@ SPI_HandleTypeDef hspi1; static __IO uint32_t TimingDelay; - +void deinit(void) +{ + HAL_DeInit(); +} volatile int i=0; int main(void) @@ -519,8 +522,17 @@ void machine() state = STATE_SETP; break; case 0: + { + ssd1306_clearscreen(); + ssd1306_DrawString("Entering Bootloader", 1, 0); + ssd1306_DrawString("(hopefully)", 2, 0); + HAL_Delay(1000); + *((unsigned long *)0x200017F0) = 0xDEADBEEF; // 6KB STM32F042 + NVIC_SystemReset(); + state = STATE_IDLE; - break; + } break; + default: state = STATE_PREHEAT_BREW; }