diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -12,7 +12,6 @@ #include "stringhelpers.h" // TODO: Grab buttonpresses with interrupts -// TODO: Eliminate screen buffer since we aren't using it... // USB Supporting Vars extern __IO uint8_t Receive_Buffer[64]; @@ -39,7 +38,6 @@ uint32_t change_time_reset = 0; #define CHANGE_ELAPSED (ticks - change_time_reset) > CHANGE_PERIOD_MS #define CHANGE_RESET change_time_reset = ticks - int16_t setpoint_brew = 0; int16_t setpoint_steam = 0; @@ -104,9 +102,18 @@ int main(void) ssd1306_Init(); ssd1306_clearscreen(); + // Check for problems on startup + if(clock_fail) { + ssd1306_DrawString("ERROR: Check Xtal", 3, 0); + delay(2000); + } + // Startup screen ssd1306_DrawString("therm v0.1", 1, 40); ssd1306_DrawString("protofusion.org/therm", 3, 0); + + + delay(1500); ssd1306_clearscreen(); @@ -370,8 +377,6 @@ void restore_settings() void user_input(uint16_t* to_modify) { if(CHANGE_ELAPSED) { - - // TODO: Make function that takes reference to a var and increase/decreases it based on buttonpress if(!GPIO_ReadInputDataBit(SW_UP) ) { CHANGE_RESET; (*to_modify)++; @@ -380,9 +385,7 @@ void user_input(uint16_t* to_modify) CHANGE_RESET; (*to_modify)--; } - } - } void machine() @@ -755,7 +758,6 @@ void TimingDelay_Decrement(void) ticks++; } - void init_spi(void) { SPI_InitTypeDef SPI_InitStructure;