mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-02 21:48:44 +05:00
refactor: added OT bus reset; increased timings for changing OT status
This commit is contained in:
1 parent
7e31de6c71
commit
6efa3a52fe
2 files changed
+38
-23
No files matched your search
+6
-4
@@ -98,8 +98,8 @@ protected:
|
||||
}
|
||||
});
|
||||
|
||||
this->instance->setYieldCallback([this]() {
|
||||
this->delay(25);
|
||||
this->instance->setDelayCallback([this](unsigned int time) {
|
||||
this->delay(time);
|
||||
});
|
||||
|
||||
this->instance->begin();
|
||||
@@ -203,12 +203,12 @@ protected:
|
||||
);
|
||||
}
|
||||
|
||||
if (!vars.slave.connected && millis() - this->lastSuccessResponse < 1150) {
|
||||
if (!vars.slave.connected && millis() - this->lastSuccessResponse < 1325) {
|
||||
Log.sinfoln(FPSTR(L_OT), F("Connected"));
|
||||
|
||||
vars.slave.connected = true;
|
||||
|
||||
} else if (vars.slave.connected && millis() - this->lastSuccessResponse > 1150) {
|
||||
} else if (vars.slave.connected && millis() - this->lastSuccessResponse > 1325) {
|
||||
Log.swarningln(FPSTR(L_OT), F("Disconnected"));
|
||||
|
||||
// Mark sensors as disconnected
|
||||
@@ -248,6 +248,8 @@ protected:
|
||||
vars.slave.diag.active = false;
|
||||
vars.slave.diag.code = 0;
|
||||
|
||||
this->instance->reset();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user