From 595a13a7c16069f38e6b1a8f8cca92f85b37f92d Mon Sep 17 00:00:00 2001 From: reaw55 <58457329+reaw55@users.noreply.github.com> Date: Mon, 8 Jan 2024 21:38:16 +0700 Subject: [PATCH] update mode_pop_callback to not loop to 0 --- src/user_code.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/user_code.cpp b/src/user_code.cpp index da86b04..161220a 100644 --- a/src/user_code.cpp +++ b/src/user_code.cpp @@ -136,8 +136,14 @@ void fan_pop_callback(void *ptr) void mode_pop_callback(void *ptr) { uint8_t current_mode = ac_get_mode(); - uint8_t new_mode = (current_mode + 1) % 3; // Loop back to 0 when reaching 2 - ac_set_state(new_mode, ac_get_temperature(), ac_get_fan_speed()); + //uint8_t new_mode = (current_mode + 1) % 3; // Loop back to 1 when reaching 2 + if(current_mode == 1) { + ac_set_state(2, ac_get_temperature(), ac_get_fan_speed()); + } else if(current_mode == 2) { + ac_set_state(1, ac_get_temperature(), ac_get_fan_speed()); + } + + //ac_set_state(new_mode, ac_get_temperature(), ac_get_fan_speed()); } void ac_toggle_pop_callback(void *ptr)