mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
tx_mode optimizations
This commit is contained in:
@@ -111,12 +111,13 @@ void EMSESP::watch_id(uint16_t watch_id) {
|
|||||||
// change the tx_mode
|
// change the tx_mode
|
||||||
// resets all counters and bumps the UART
|
// resets all counters and bumps the UART
|
||||||
void EMSESP::reset_tx(uint8_t const tx_mode) {
|
void EMSESP::reset_tx(uint8_t const tx_mode) {
|
||||||
txservice_.telegram_read_count(0);
|
|
||||||
txservice_.telegram_write_count(0);
|
|
||||||
txservice_.telegram_fail_count(0);
|
|
||||||
if (tx_mode) {
|
|
||||||
EMSuart::stop();
|
EMSuart::stop();
|
||||||
|
|
||||||
|
txservice_.start();
|
||||||
|
|
||||||
EMSuart::start(tx_mode);
|
EMSuart::start(tx_mode);
|
||||||
|
|
||||||
|
if (tx_mode != 0) {
|
||||||
EMSESP::fetch_device_values();
|
EMSESP::fetch_device_values();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -773,6 +774,7 @@ void EMSESP::loop() {
|
|||||||
|
|
||||||
// if we're doing an OTA upload, skip MQTT and EMS
|
// if we're doing an OTA upload, skip MQTT and EMS
|
||||||
if (system_.upload_status()) {
|
if (system_.upload_status()) {
|
||||||
|
delay(1); // slow down OTA update to avoid getting killed by task watchdog (task_wdt)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user