diff --git a/platformio.ini b/platformio.ini index 8bd5bc5..2ad267e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -14,6 +14,6 @@ board = wt32-eth01 framework = arduino lib_deps = siwats/ESPMegaPROR3@^2.4.3 monitor_speed = 115200 -build_flags = -DCORE_DEBUG_LEVEL=5 +build_flags = -DCORE_DEBUG_LEVEL=0 monitor_port = COM36 upload_port = COM36 \ No newline at end of file diff --git a/src/display.cpp b/src/display.cpp index 5022f86..39680f5 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -177,6 +177,7 @@ void CUDDisplay::display_init() // Perform a reset on the display ESP_LOGV("CUD Display", "Resetting display"); this->reset(); + vTaskDelay(1000 / portTICK_PERIOD_MS); // Set the display to the main screen ESP_LOGV("CUD Display", "Setting display to main screen"); this->jumpToPage(LCD_PAGE_ID_DASHBOARD); @@ -424,7 +425,7 @@ void CUDDisplay::handle_touch(uint8_t page_id, uint8_t element_id, uint8_t touch last_ac_button_press = millis(); // Send the new temperature to the Display this->takeSerialMutex(); - this->displayAdapter->printf("%s.txt=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMPERATURE, newTemp); + this->displayAdapter->printf("%s.txt=\"%d\"", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMPERATURE, newTemp); this->sendStopBytes(); this->giveSerialMutex(); return; @@ -441,6 +442,7 @@ void CUDDisplay::handle_touch(uint8_t page_id, uint8_t element_id, uint8_t touch // If the button press is pending, use the pending temperature as base newTemp = this->pending_temperature; } + newTemp--; // Does the temperature exceed the lower bound?, if it does, bound it ESP_LOGD("CUD Display", "Requested Temp: %d, Lower Bound: %d", newTemp, this->ac_temp_lower_bound.getIntValue()); if (newTemp < this->ac_temp_lower_bound.getIntValue()) @@ -454,7 +456,7 @@ void CUDDisplay::handle_touch(uint8_t page_id, uint8_t element_id, uint8_t touch last_ac_button_press = millis(); // Send the new temperature to the Display this->takeSerialMutex(); - this->displayAdapter->printf("%s.txt=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMPERATURE, newTemp); + this->displayAdapter->printf("%s.txt=\"%d\"", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMPERATURE, newTemp); this->sendStopBytes(); this->giveSerialMutex(); return;