Fix: Queue consumed whole memory on inverter timeout
When the poll interval was e.g. 1sec it was possible that the queue ran full and consumed the whole memory. Now new entries are only added to the queue automatically if the queue is empty. This issue also caused a lot of "DTU command failed" messages.
This commit is contained in:
parent
5996fb0edf
commit
0441bbbe72
@ -54,7 +54,7 @@ void HoymilesClass::loop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iv != nullptr && iv->getRadio()->isInitialized() && iv->getRadio()->isIdle()) {
|
if (iv != nullptr && iv->getRadio()->isInitialized() && iv->getRadio()->isQueueEmpty()) {
|
||||||
_messageOutput->print("Fetch inverter: ");
|
_messageOutput->print("Fetch inverter: ");
|
||||||
_messageOutput->println(iv->serial(), HEX);
|
_messageOutput->println(iv->serial(), HEX);
|
||||||
|
|
||||||
|
|||||||
@ -70,3 +70,8 @@ bool HoymilesRadio::isIdle()
|
|||||||
{
|
{
|
||||||
return !_busyFlag;
|
return !_busyFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HoymilesRadio::isQueueEmpty()
|
||||||
|
{
|
||||||
|
return _commandQueue.size() == 0;
|
||||||
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ public:
|
|||||||
virtual void setDtuSerial(uint64_t serial);
|
virtual void setDtuSerial(uint64_t serial);
|
||||||
|
|
||||||
bool isIdle();
|
bool isIdle();
|
||||||
|
bool isQueueEmpty();
|
||||||
bool isInitialized();
|
bool isInitialized();
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user