diff --git a/display.c b/display.c --- a/display.c +++ b/display.c @@ -25,7 +25,7 @@ static uint8_t sw_right_last = 0; static uint8_t trigger_drawsetpoint = 1; static int16_t last_temp = 21245; static int16_t last_temp_frac = 21245; -static int16_t last_state = STATE_IDLE; +static int16_t last_state = STATE_RESET; static uint8_t goto_mode = MODE_HEAT; static uint8_t reset_mode = RESET_REBOOT; @@ -409,8 +409,20 @@ void display_process(therm_settings_t* s itoa(status->error_code, tempstr, 10); ssd1306_drawstring(tempstr, 0, 57); - //TODO: add RTD error codes - + #ifdef MAX31865_RTD_SENSOR + // RTD error codes + if(status->error_code & 0b00000100) + ssd1306_drawstring(" RTD Over/Undervolt", 1, 0); + else if(status->error_code & 0b00001000) + ssd1306_drawstring(" RTD FORCE- Open", 1, 0); + else if(status->error_code & 0b00010000) + ssd1306_drawstring("RTD REF FORCE- Open", 1, 0); + else if(status->error_code & 0b00100000) + ssd1306_drawstring(" RTD REFIN- High", 1, 0); + else + ssd1306_drawstring("#?, Unknown Error", 1, 0); + #else + // TC error codes if(status->error_code == 1) ssd1306_drawstring(" TC Open Circuit", 1, 0); else if(status->error_code == 4) @@ -419,6 +431,7 @@ void display_process(therm_settings_t* s ssd1306_drawstring(" TC Short to VCC", 1, 0); else ssd1306_drawstring("#?, Unknown Error", 1, 0); + #endif ssd1306_drawstring(" ", 2, 0); ssd1306_drawstring("-> to ignore all or", 2, 0);