From 7c8b7a97addb9ed52c295b5cab82b6422dccd260 Mon Sep 17 00:00:00 2001 From: Thad House Date: Wed, 13 Dec 2023 15:20:24 -0800 Subject: [PATCH] [wpiutil] Zero out roborio system timestamp (#6042) There was also an issue where the clock zero offset would be incorrect due to the system time updating. This solves that issue for the Rio. --- wpiutil/src/main/native/cpp/timestamp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpiutil/src/main/native/cpp/timestamp.cpp b/wpiutil/src/main/native/cpp/timestamp.cpp index acf5d9bfad..c811964afd 100644 --- a/wpiutil/src/main/native/cpp/timestamp.cpp +++ b/wpiutil/src/main/native/cpp/timestamp.cpp @@ -267,7 +267,7 @@ uint64_t wpi::Now() { // Same code as HAL_GetFPGATime() if (!hmbInitialized.test()) { if (nowUseDefaultOnFailure.test()) { - return (now_impl.load())(); + return timestamp() - offset_val; } else { fmt::print( stderr,