Changeset - 7ddd50ea7e9a
[Not reviewed]
default
0 1 0
Ethan Zonca - 10 years ago 2015-01-02 23:40:21
ez@ethanzonca.com
Clear screen when switching state, etc
1 file changed with 6 insertions and 1 deletions:
main.c
6
1
0 comments (0 inline, 0 general)
main.c
Show inline comments
 
@@ -144,6 +144,7 @@ int main(void)
 
// Read temperature and update global temp vars
 
int32_t temp = 0;
 
uint8_t temp_frac = 0;
 
uint8_t state_resume = 0;
 
 
void update_temp() {
 
    // Assert CS
 
@@ -160,6 +161,7 @@ void update_temp() {
 
        state = STATE_TC_ERROR;
 
    }
 
    else if(temp_pre & 0b0000000000000001 && !ignore_tc_error) {
 
        state_resume = state;
 
        state = STATE_TC_ERROR;
 
        temp = 0;
 
        temp_frac = 0;
 
@@ -167,7 +169,10 @@ void update_temp() {
 
    else 
 
    {
 
        if(state == STATE_TC_ERROR)
 
            state = STATE_IDLE;
 
        {
 
            state = state_resume;
 
            ssd1306_clearscreen();
 
        }
 
 
        uint8_t sign = temp >> 15;// top bit is sign
 
0 comments (0 inline, 0 general)