Changeset - f4ef22eb5176
[Not reviewed]
cortex-f0
0 3 0
Ethan Zonca - 9 years ago 2015-06-01 17:18:30
ez@ethanzonca.com
Added support for detecting which thermocouple error occurred
3 files changed with 13 insertions and 3 deletions:
0 comments (0 inline, 0 general)
display.c
Show inline comments
 
@@ -498,7 +498,14 @@ void display_process(therm_settings_t* s
 
            // [ therm : ready to steam ]
 
            // [ 30 => 120 C            ]
 
            ssd1306_DrawString("Error:", 0, 0);
 
            ssd1306_DrawString("Connect thermocouple", 1, 0);
 

	
 
            if(status->tc_errno == 1)
 
                ssd1306_DrawString("#1, Check Sensor", 1, 0);
 
            else if(status->tc_errno == 4)
 
                ssd1306_DrawString("#4, Check Sensor", 1, 0);
 
            else
 
                ssd1306_DrawString("#?, Unknown Error", 1, 0);
 

	
 
            ssd1306_DrawString("Press -> to ignore", 3, 0);
 

	
 
            // Button handler
main.c
Show inline comments
 
@@ -162,13 +162,15 @@ void update_temp() {
 
 
    if(temp_pre & 0b0000000000000010) {
 
        ssd1306_clearscreen();
 
        //ssd1306_DrawString("Fatal Error", 3, 35);
 
        HAL_Delay(100);
 
        HAL_Delay(100); // FIXME: remove?
 
        status.tc_errno = 4;
 
        status.state = STATE_TC_ERROR;
 
        status.temp = 0;
 
        status.temp_frac = 0;
 
    }
 
    else if(temp_pre & 0b0000000000000001 && !set.ignore_tc_error) {
 
        status.tc_errno = 1;
 
        HAL_Delay(100); // FIXME: remove?
 
        status.state_resume = status.state;
 
        status.state = STATE_TC_ERROR;
 
        status.temp = 0;
states.h
Show inline comments
 
@@ -8,6 +8,7 @@ typedef struct {
 
    uint8_t state;
 
    int32_t setpoint;
 
    uint8_t pid_enabled;
 
    uint8_t tc_errno;
 
} therm_status_t;
 

	
 
typedef struct {
0 comments (0 inline, 0 general)