mirror of https://github.com/arendst/Tasmota.git
Merge pull request #6562 from ljakob/development
process Backlog commands without minimum delay
This commit is contained in:
commit
cfe301474a
|
@ -870,21 +870,6 @@ void Every100mSeconds(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Backlog
|
||||
if (TimeReached(backlog_delay)) {
|
||||
if (!BACKLOG_EMPTY && !backlog_mutex) {
|
||||
backlog_mutex = true;
|
||||
#ifdef SUPPORT_IF_STATEMENT
|
||||
ExecuteCommand((char*)backlog.shift().c_str(), SRC_BACKLOG);
|
||||
#else
|
||||
ExecuteCommand((char*)backlog[backlog_pointer].c_str(), SRC_BACKLOG);
|
||||
backlog_pointer++;
|
||||
if (backlog_pointer >= MAX_BACKLOG) { backlog_pointer = 0; }
|
||||
#endif
|
||||
backlog_mutex = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------*\
|
||||
|
@ -1629,6 +1614,23 @@ void setup(void)
|
|||
XsnsCall(FUNC_INIT);
|
||||
}
|
||||
|
||||
static void BacklogLoop()
|
||||
{
|
||||
if (TimeReached(backlog_delay)) {
|
||||
if (!BACKLOG_EMPTY && !backlog_mutex) {
|
||||
backlog_mutex = true;
|
||||
#ifdef SUPPORT_IF_STATEMENT
|
||||
ExecuteCommand((char*)backlog.shift().c_str(), SRC_BACKLOG);
|
||||
#else
|
||||
ExecuteCommand((char*)backlog[backlog_pointer].c_str(), SRC_BACKLOG);
|
||||
backlog_pointer++;
|
||||
if (backlog_pointer >= MAX_BACKLOG) { backlog_pointer = 0; }
|
||||
#endif
|
||||
backlog_mutex = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
{
|
||||
uint32_t my_sleep = millis();
|
||||
|
@ -1640,6 +1642,7 @@ void loop(void)
|
|||
|
||||
ButtonLoop();
|
||||
SwitchLoop();
|
||||
BacklogLoop();
|
||||
#ifdef ROTARY_V1
|
||||
RotaryLoop();
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue