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 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user