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

+1 -1
View File
@@ -41,7 +41,7 @@
// 1 = print every raw UART frame candidate as hex on the Serial // 1 = print every raw UART frame candidate as hex on the Serial
// Monitor (115200). Use this to capture real traffic from the // Monitor (115200). Use this to capture real traffic from the
// module so the frame format can be confirmed/reverse-engineered. // module so the frame format can be confirmed/reverse-engineered.
#define DEBUG_RADAR_RAW 0 #define DEBUG_RADAR_RAW 1
// 1 = diagnostic mode only: Serial-only target printout, no Wi-Fi, // 1 = diagnostic mode only: Serial-only target printout, no Wi-Fi,
// no web server, no WebSocket. This is the recommended first // no web server, no WebSocket. This is the recommended first
+18 -1
View File
@@ -109,7 +109,24 @@ void loop() {
#endif #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(); webServer.loop();
#endif #endif
} }