mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 11:49:51 +03:00
modbus speedup update
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user