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->println(iv->serial(), HEX);
|
||||
|
||||
|
||||
@ -69,4 +69,9 @@ bool HoymilesRadio::isInitialized()
|
||||
bool HoymilesRadio::isIdle()
|
||||
{
|
||||
return !_busyFlag;
|
||||
}
|
||||
}
|
||||
|
||||
bool HoymilesRadio::isQueueEmpty()
|
||||
{
|
||||
return _commandQueue.size() == 0;
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ public:
|
||||
virtual void setDtuSerial(uint64_t serial);
|
||||
|
||||
bool isIdle();
|
||||
bool isQueueEmpty();
|
||||
bool isInitialized();
|
||||
|
||||
template <typename T>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user