From 2522901918c795d40e312c46431700350ba193ab Mon Sep 17 00:00:00 2001 From: Ben Nicholson Date: Fri, 25 Sep 2026 07:08:42 +1000 Subject: [PATCH] PTP: don't report the pre-step offset After a clock step, status.ptp showed the whole step (~1.79e18 ns) as offset_ns until the next Sync, and the 60 s summary reported it as max |offset|. Offset is reset to 0 and the summary restarts on a step. Verified: status goes 0 -> pull-in values; first summary max 24960 ns. Co-Authored-By: Claude Opus 5.5 --- components/aes67_ptp/ptp_clock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/aes67_ptp/ptp_clock.c b/components/aes67_ptp/ptp_clock.c index 2b5548b..d8c1372 100644 --- a/components/aes67_ptp/ptp_clock.c +++ b/components/aes67_ptp/ptp_clock.c @@ -268,6 +268,9 @@ static void servo(int64_t offset) ESP_LOGI(TAG, "clock stepped by %+lld ns (%s), frequency %+.3f ppm", -offset, esp_err_to_name(err), s.freq_ppb / 1000); s.stepped = true; + s.offset_ns = 0; // the pre-step offset is history: not for status or the summary + s.sum_max_ns = 0; + s.sum_start_us = 0; s.prev_t2 = 0; // rate across the step is meaningless s.bad = 0; set_locked(false);