@@ -179,9 +179,11 @@ void update_temp() {
if(temp_pre & 0b0000000000000010) {
ssd1306_clearscreen();
ssd1306_DrawString("Fatal Error", 3, 35);
//ssd1306_DrawString("Fatal Error", 3, 35);
HAL_Delay(100);
state = STATE_TC_ERROR;
temp = 0;
temp_frac = 0;
}
else if(temp_pre & 0b0000000000000001 && !ignore_tc_error) {
state_resume = state;
@@ -231,6 +233,7 @@ void update_temp() {
// Print temp to cdc
/*
CDC_Transmit_FS("Temp: ", 6);
char tempstr[6];
zitoa(temp, tempstr);
@@ -241,7 +244,7 @@ void update_temp() {
CDC_Transmit_FS("\r\n", 2);
*/
@@ -351,16 +354,6 @@ void process()
void draw_setpoint() {
char tempstr[3];
itoa_fp(temp, temp_frac, tempstr);
ssd1306_DrawStringBig(" ", 3, 0);
ssd1306_DrawStringBig(tempstr, 3, 0);
ssd1306_DrawStringBig(">", 3, 74);
itoa(setpoint, tempstr, 10);
ssd1306_DrawStringBig(" ", 3, 90);
ssd1306_DrawStringBig(tempstr, 3, 90);
uint8_t goto_mode = 2;
@@ -450,6 +443,35 @@ uint8_t final_setpoint = 0;
////////////////////////////////////////////////////////////////////////////////////////////////
uint8_t trigger_drawsetpoint = 1;
int32_t temp_last = 43002;
int32_t setpoint_last = 10023;
// FIXME: need to do this when switching modes too
if(temp != temp_last || trigger_drawsetpoint) {
if(trigger_drawsetpoint)
if(setpoint != setpoint_last || trigger_drawsetpoint) {
trigger_drawsetpoint = 0;
setpoint_last = setpoint;
temp_last = temp;
void machine()
{
uint8_t last_state = state;
@@ -767,6 +789,7 @@ void machine()
ssd1306_DrawString("Preheating...", 0, 0);
//ssd1306_drawlogo();
draw_setpoint();
pid_enabled = 1;
setpoint = setpoint_brew;
@@ -899,6 +922,7 @@ void machine()
if(last_state != state) {
// Clear screen on state change
goto_mode = 2;
trigger_drawsetpoint = 1;
Status change: