diff --git a/platformio.ini b/platformio.ini index 2ad267e..a6ccc4b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,8 +12,6 @@ platform = espressif32 board = wt32-eth01 framework = arduino -lib_deps = siwats/ESPMegaPROR3@^2.4.3 +lib_deps = siwats/ESPMegaPROR3@^2.5.5 monitor_speed = 115200 -build_flags = -DCORE_DEBUG_LEVEL=0 -monitor_port = COM36 -upload_port = COM36 \ No newline at end of file +build_flags = -DCORE_DEBUG_LEVEL=5 \ No newline at end of file diff --git a/src/display.cpp b/src/display.cpp index 8864a4b..9588b61 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -149,6 +149,7 @@ void CUDDisplay::begin(cud_display_cards_t cards) // If any of the bound is invalid, set all to default if (this->ac_temp_lower_bound.getIntValue() < AC_MIN_TEMP || this->ac_temp_upper_bound.getIntValue() > AC_MAX_TEMP || this->ac_temp_lower_bound.getIntValue() >= this->ac_temp_upper_bound.getIntValue()) { + ESP_LOGW("CUD Display", "Temperature Bounds are invalid, setting to default"); this->ac_temp_lower_bound.setIntValue(DEFAULT_TEMP_LOWER_BOUND); this->ac_temp_upper_bound.setIntValue(DEFAULT_TEMP_UPPER_BOUND); } @@ -539,9 +540,15 @@ void CUDDisplay::handle_bound_change(char *value) // Lower Bound can't be less than AC_MIN_TEMP // Upper Bound can't be more than AC_MAX_TEMP // If any of the bound is invalid, set all to default - if (this->ac_temp_lower_bound.getIntValue() < AC_MIN_TEMP || this->ac_temp_upper_bound.getIntValue() > AC_MAX_TEMP || this->ac_temp_lower_bound.getIntValue() >= this->ac_temp_upper_bound.getIntValue()) + if (this->ac_temp_lower_bound.getIntValue() < AC_MIN_TEMP || this->ac_temp_lower_bound.getIntValue() >= this->ac_temp_upper_bound.getIntValue()) { + ESP_LOGV("CUD Display", "Invalid Lower Bound, Setting to Default"); this->ac_temp_lower_bound.setIntValue(DEFAULT_TEMP_LOWER_BOUND); + } + + if (this->ac_temp_upper_bound.getIntValue() > AC_MAX_TEMP || this->ac_temp_lower_bound.getIntValue() >= this->ac_temp_upper_bound.getIntValue()) + { + ESP_LOGV("CUD Display", "Invalid Upper Bound, Setting to Default"); this->ac_temp_upper_bound.setIntValue(DEFAULT_TEMP_UPPER_BOUND); } // Does the current temperature exceed the new upper bound?, if it does, bound it