add display delay

This commit is contained in:
Siwat Sirichai 2024-03-23 16:09:52 +07:00
parent 245709870b
commit f0a9c4f1d0
2 changed files with 5 additions and 3 deletions

View File

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

View File

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