From f7e3b0fa898c7f5372cb62c520285eb554b7ed3d Mon Sep 17 00:00:00 2001 From: "Daniel P. Carvalho" Date: Sun, 20 Sep 2026 13:58:13 -0300 Subject: [PATCH] drivers/timers/ptp_clock_dummy: fix the nanoseconds of the monotonic time. ptp_clock_dummy_getcrosststamp() stored the seconds of the monotonic clock in the nanoseconds field of the monoraw member, so the monotonic time of the cross timestamp was wrong. Store the nanoseconds. Signed-off-by: Daniel P. Carvalho Assisted-by: Claude:claude-sonnet-5 --- drivers/timers/ptp_clock_dummy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/timers/ptp_clock_dummy.c b/drivers/timers/ptp_clock_dummy.c index 4ee0513b215..9ffa9b3fb37 100644 --- a/drivers/timers/ptp_clock_dummy.c +++ b/drivers/timers/ptp_clock_dummy.c @@ -144,7 +144,7 @@ ptp_clock_dummy_getcrosststamp(FAR struct ptp_lowerhalf_s *lower, clock_gettime(CLOCK_MONOTONIC, &ts); cts->monoraw.tv_sec = ts.tv_sec; - cts->monoraw.tv_nsec = ts.tv_sec; + cts->monoraw.tv_nsec = ts.tv_nsec; ptpinfo("ptp_clock_dummy_getcrosststamp sec:%jd, nsec:%ld\n", (intmax_t)ts.tv_sec, ts.tv_nsec);