This commit is contained in:
admin committed 2026-09-11 13:18:23 +07:00
1 parent ad4002ecfb
commit d163397de4
2 files changed
+19 -2

No files matched your search

+18 -1
View File
@@ -109,7 +109,24 @@ void loop() {
#endif
}
#if !DIAGNOSTIC_MODE
#if DIAGNOSTIC_MODE
// Print stats periodically even if no frame is parsed yet
static uint32_t lastStatsReport = 0;
uint32_t now = millis();
if (now - lastStatsReport >= 5000) { // every 5 seconds
const LD2453Stats &stats = radar.getStats();
Serial.println(F("\n--- Periodic Status ---"));
Serial.print(F("Bytes received: "));
Serial.println(stats.bytesReceived);
Serial.print(F("Frames parsed: "));
Serial.println(stats.framesParsed);
Serial.print(F("Parse errors: "));
Serial.println(stats.parseErrors);
Serial.print(F("Packets/sec: "));
Serial.println(stats.packetsPerSecond, 1);
lastStatsReport = now;
}
#else
webServer.loop();
#endif
}