diff --git a/src/user_code.cpp b/src/user_code.cpp index a50675b..d9c70a3 100644 --- a/src/user_code.cpp +++ b/src/user_code.cpp @@ -139,15 +139,15 @@ void fan_pop_callback(void *ptr) void mode_pop_callback(void *ptr) { - // uint8_t current_mode = ac_get_mode(); - user_acmode = ac_get_mode(); + uint8_t current_mode = ac_get_mode(); + //user_acmode = ac_get_mode(); // uint8_t new_mode = (current_mode + 1) % 3; // Loop back to 1 when reaching 2 - if (user_acmode == 1) + if (current_mode == 1) { user_acmode = 2; ac_set_state(2, ac_get_temperature(), ac_get_fan_speed()); } - else if (user_acmode == 2) + else if (current_mode == 2) { user_acmode = 1; ac_set_state(1, ac_get_temperature(), ac_get_fan_speed()); @@ -453,7 +453,7 @@ void update_lcd_ac() } // update the mode cool is 22, fan mode is 24, for off the toggle button act as indicator // Mode 0: Off, 1: Cool, 2: Fan - uint8_t mode_state = ac_get_mode(); + uint8_t mode_state = user_acmode; // mode.Set_background_image_pic(mode_state==1?22:24); elcd_send_stop_bit(); if (mode_state == 1)