modbus speedup update

This commit is contained in:
2021-05-15 15:47:28 +03:00
parent 264b61e7e6
commit bb65782ad0
2 changed files with 7 additions and 8 deletions

View File

@@ -1097,10 +1097,10 @@ int Item::isActive() {
if (val) return 1; else return 0; if (val) return 1; else return 0;
} }
void Item::resumeModbus() bool Item::resumeModbus()
{ {
// return;
if (modbusBusy) return; if (modbusBusy) return false;
configLocked++; configLocked++;
if (items) { if (items) {
aJsonObject * item = items->child; aJsonObject * item = items->child;
@@ -1119,17 +1119,16 @@ if (items) {
} //if } //if
} }
configLocked--; configLocked--;
return true;
} }
int Item::Poll(int cause) { int Item::Poll(int cause) {
#ifndef MODBUS_DISABLE #ifndef MODBUS_DISABLE
if (isPendedModbusWrites) if (isPendedModbusWrites && resumeModbus())
{
resumeModbus();
isPendedModbusWrites=false; isPendedModbusWrites=false;
}
#endif #endif
switch (cause) switch (cause)
{ {

View File

@@ -151,7 +151,7 @@ class Item
boolean checkVCRetry(); boolean checkVCRetry();
boolean checkHeatRetry(); boolean checkHeatRetry();
void sendDelayedStatus(); void sendDelayedStatus();
void resumeModbus(); bool resumeModbus();
int checkFM(); int checkFM();