diff --git a/display.c b/display.c --- a/display.c +++ b/display.c @@ -341,8 +341,7 @@ void display_process(therm_settings_t* s // Button handler if(SW_BTN_PRESSED) { - save_settings(); - status->state = STATE_IDLE; + status->state = STATE_SETTEMPOFFSET; } else if(!HAL_GPIO_ReadPin(SW_UP)) { set->temp_units = TEMP_UNITS_FAHRENHEIT; @@ -357,6 +356,37 @@ void display_process(therm_settings_t* s } break; + case STATE_SETTEMPOFFSET: + { + // Write text to OLED + // [ therm :: set temp offset ] + // [ g = 12 ] + ssd1306_DrawString("Thermocouple Offset", 0, 40); + ssd1306_drawlogo(); + + char tempstr[6]; + itoa(set->temp_offset, tempstr, 10); + ssd1306_DrawString("O=", 1, 45); + ssd1306_DrawString(" ", 1, 57); + ssd1306_DrawString(tempstr, 1, 57); + + ssd1306_DrawString("Press to accept", 3, 40); + + // Button handler + if(SW_BTN_PRESSED) { + save_settings(); + status->state = STATE_IDLE; + } + else { + user_input_signed(&set->temp_offset); + } + + // Event Handler + // N/A + + } break; + + case STATE_PREHEAT_BREW: { // Write text to OLED