Minor update

This commit is contained in:
Magnus Persson 2022-02-02 13:30:48 +01:00
parent 7ab5f451f5
commit 4c789a8b37
2 changed files with 3 additions and 4 deletions

View File

@ -248,17 +248,18 @@ bool loopReadGravity() {
angle, tempC, gravity, corrGravity);
#endif
LOG_PERF_START("loop-push");
bool pushExpired = (abs((int32_t)(millis() - pushMillis)) >
(myConfig.getSleepInterval() * 1000));
if (pushExpired || runMode == RunMode::gravityMode) {
pushMillis = millis();
LOG_PERF_START("loop-push");
PushTarget push;
push.send(angle, gravitySG, corrGravitySG, tempC,
(millis() - runtimeMillis) / 1000);
LOG_PERF_STOP("loop-push");
LOG_PERF_PUSH();
}
LOG_PERF_STOP("loop-push");
return true;
} else {
Log.error(F("MAIN: No gyro value found, the device might be moving."));

View File

@ -75,8 +75,6 @@ void PushTarget::send(float angle, float gravitySG, float corrGravitySG,
sendMqtt(engine, myConfig.isMqttSSL());
LOG_PERF_STOP("push-mqtt");
}
LOG_PERF_PUSH();
}
//