ESPHome 2025.7.4
Loading...
Searching...
No Matches
nextion_upload.cpp
Go to the documentation of this file.
1#include "nextion.h"
2
3#ifdef USE_NEXTION_TFT_UPLOAD
4
6
7namespace esphome {
8namespace nextion {
9static const char *const TAG = "nextion.upload";
10
11bool Nextion::upload_end_(bool successful) {
12 if (successful) {
13 ESP_LOGD(TAG, "Upload successful");
14 delay(1500); // NOLINT
16 } else {
17 ESP_LOGE(TAG, "Upload failed");
18
19 this->connection_state_.is_updating_ = false;
20 this->connection_state_.ignore_is_setup_ = false;
21
22 uint32_t baud_rate = this->parent_->get_baud_rate();
23 if (baud_rate != this->original_baud_rate_) {
24 ESP_LOGD(TAG, "Baud: %" PRIu32 "->%" PRIu32, baud_rate, this->original_baud_rate_);
26 this->parent_->load_settings();
27 }
28 }
29
30 return successful;
31}
32
33} // namespace nextion
34} // namespace esphome
35
36#endif // USE_NEXTION_TFT_UPLOAD
bool upload_end_(bool successful)
Ends the upload process, restart Nextion and, if successful, restarts ESP.
struct esphome::nextion::Nextion::@139 connection_state_
Status flags for Nextion display state management.
virtual void load_settings(bool dump_config)
Load the UART settings.
void set_baud_rate(uint32_t baud_rate)
UARTComponent * parent_
Definition uart.h:68
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
void IRAM_ATTR HOT delay(uint32_t ms)
Definition core.cpp:29
Application App
Global storage of Application pointer - only one Application can exist.