potential bugfix for nag cutoff

This commit is contained in:
Thomas Göttgens
2022-12-27 21:51:35 +01:00
parent 34f9324766
commit 6f6ca64cfd
3 changed files with 19 additions and 19 deletions

View File

@@ -38,6 +38,20 @@ int32_t ExternalNotificationModule::runOnce()
return INT32_MAX; // we don't need this thread here...
} else {
if (nagCycleCutoff < millis()) {
nagCycleCutoff = UINT32_MAX;
DEBUG_MSG("Turning off external notification: ");
for (int i = 0; i < 2; i++) {
if (getExternal(i)) {
setExternalOff(i);
externalTurnedOn[i] = 0;
DEBUG_MSG("%d ", i);
}
}
DEBUG_MSG("\n");
return INT32_MAX; // save cycles till we're needed again
}
// If the output is turned on, turn it back off after the given period of time.
if (nagCycleCutoff != UINT32_MAX) {
if (externalTurnedOn[0] + (moduleConfig.external_notification.output_ms
@@ -56,20 +70,6 @@ int32_t ExternalNotificationModule::runOnce()
getExternal(2) ? setExternalOff(2) : setExternalOn(2);
}
}
if (nagCycleCutoff < millis()) {
nagCycleCutoff = UINT32_MAX;
DEBUG_MSG("Turning off external notification: ");
for (int i = 0; i < 2; i++) {
if (getExternal(i)) {
setExternalOff(i);
externalTurnedOn[i] = 0;
DEBUG_MSG("%d ", i);
}
}
DEBUG_MSG("\n");
return INT32_MAX; // save cycles till we're needed again
}
return 25;
}
}