diff --git a/src/main.cpp b/src/main.cpp index d9a75f8..ffbbf7d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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.")); diff --git a/src/pushtarget.cpp b/src/pushtarget.cpp index 6370717..2f087b2 100644 --- a/src/pushtarget.cpp +++ b/src/pushtarget.cpp @@ -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(); } //