[SYS] Avoid queue overloading at start (#2114)
Give one cycle of the loop without starting BT Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
1 parent
8bad846d94
commit
1f45a7711b
1 file changed
+2
-2
+2
-2
@@ -69,7 +69,7 @@ bool firstStart = true;
|
|||||||
#define ARDUINOJSON_ENABLE_STD_STRING 1
|
#define ARDUINOJSON_ENABLE_STD_STRING 1
|
||||||
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
int queueLength = 0;
|
int queueLength = -1; // We want to give one cycle of the loop before starting modules that are big msgs producers (example BT), to avoid queue overloading
|
||||||
unsigned long queueLengthSum = 0;
|
unsigned long queueLengthSum = 0;
|
||||||
unsigned long blockedMessages = 0;
|
unsigned long blockedMessages = 0;
|
||||||
unsigned long receivedMessages = 0;
|
unsigned long receivedMessages = 0;
|
||||||
@@ -522,7 +522,7 @@ void emptyQueue() {
|
|||||||
if (queueLength > maxQueueLength) {
|
if (queueLength > maxQueueLength) {
|
||||||
maxQueueLength = queueLength;
|
maxQueueLength = queueLength;
|
||||||
}
|
}
|
||||||
if (queueLength == 0) {
|
if (queueLength <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log.trace(F("Dequeue JSON" CR));
|
Log.trace(F("Dequeue JSON" CR));
|
||||||
|
|||||||
Reference in new issue
Block a user