Merge pull request #7185 from laurentdong/backlog-if

Embeded IF statement in backlog did not been processed
This commit is contained in:
Theo Arends 2019-12-11 17:46:50 +01:00 committed by GitHub
commit ad5f3ead1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -349,15 +349,18 @@ void BacklogLoop(void)
{
if (TimeReached(backlog_delay)) {
if (!BACKLOG_EMPTY && !backlog_mutex) {
backlog_mutex = true;
#ifdef SUPPORT_IF_STATEMENT
ExecuteCommand((char*)backlog.shift().c_str(), SRC_BACKLOG);
backlog_mutex = true;
String cmd = backlog.shift();
backlog_mutex = false;
ExecuteCommand((char*)cmd.c_str(), SRC_BACKLOG);
#else
backlog_mutex = true;
ExecuteCommand((char*)backlog[backlog_pointer].c_str(), SRC_BACKLOG);
backlog_pointer++;
if (backlog_pointer >= MAX_BACKLOG) { backlog_pointer = 0; }
#endif
backlog_mutex = false;
#endif
}
}
}