Fix backlog nodelay when sleep is active

This commit is contained in:
Theo Arends 2021-04-09 12:49:57 +02:00
parent b8f2c97fbe
commit dd7cecc064
2 changed files with 7 additions and 1 deletions

View File

@ -323,7 +323,11 @@ void CmndBacklog(void) {
if (XdrvMailbox.data_len) {
if (0 == XdrvMailbox.index) {
if (!TasmotaGlobal.backlog_nodelay) {
TasmotaGlobal.backlog_sleep = TasmotaGlobal.sleep;
}
TasmotaGlobal.backlog_nodelay = true;
TasmotaGlobal.sleep = 0;
}
#ifdef SUPPORT_IF_STATEMENT

View File

@ -170,6 +170,7 @@ struct {
uint8_t latching_relay_pulse; // Latching relay pulse timer
uint8_t active_device; // Active device in ExecuteCommandPower
uint8_t sleep; // Current copy of Settings.sleep
uint8_t backlog_sleep; // Copy of sleep
uint8_t leds_present; // Max number of LED supported
uint8_t led_inverted; // LED inverted flag (1 = (0 = On, 1 = Off))
uint8_t led_power; // LED power state
@ -404,8 +405,9 @@ void BacklogLoop(void) {
}
TasmotaGlobal.backlog_mutex = false;
}
if (BACKLOG_EMPTY) {
if (BACKLOG_EMPTY && TasmotaGlobal.backlog_nodelay) {
TasmotaGlobal.backlog_nodelay = false;
TasmotaGlobal.sleep = TasmotaGlobal.backlog_sleep;
}
}
}