try to fix toggle

This commit is contained in:
reaw55 2024-01-08 22:07:39 +07:00
parent c4fe483975
commit a6f1eb34e3
1 changed files with 5 additions and 5 deletions

View File

@ -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)