@@ -376,97 +376,101 @@ void display_process(therm_settings_t* s
set->val.temp_units = TEMP_UNITS_FAHRENHEIT;
}
else if(!HAL_GPIO_ReadPin(SW_DOWN)) {
set->val.temp_units = TEMP_UNITS_CELSIUS;
// Event Handler
// N/A
} break;
case STATE_SETTEMPOFFSET:
{
// Write text to OLED
// [ therm :: set temp offset ]
// [ g = 12 ]
ssd1306_drawstring("Temp Cal Offset", 0, 40);
ssd1306_drawlogo();
char tempstr[6];
itoa(set->val.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) {
flash_save(set);
status->state = STATE_IDLE;
else {
user_input_signed(&set->val.temp_offset);
case STATE_PREHEAT:
// [ therm : preheating brew ]
// [ 30 => 120 C ]
if(set->val.plant_type == PLANT_HEATER)
ssd1306_drawstring("Preheating...", 0, 0);
else
ssd1306_drawstring("Precooling...", 0, 0);
//ssd1306_drawlogo();
draw_setpoint(status);
status->pid_enabled = 1;
status->setpoint = set->val.setpoint_brew;
user_input((uint16_t*)&set->val.setpoint_brew);
if(status->temp >= status->setpoint) {
status->state = STATE_MAINTAIN;
case STATE_MAINTAIN:
// [ therm : ready to brew ]
ssd1306_drawstring("Preheated!", 0, 0);
ssd1306_drawstring("Precooled!", 0, 0);
Status change: