timed: set valid flag (#32061)

* timed: set valid flag

* oops
old-commit-hash: 43832335b8e44e40683ffe6afa226a2d2de0d6ff
This commit is contained in:
Adeeb Shihadeh
2024-03-30 17:47:21 -07:00
committed by GitHub
parent 05d0243ff5
commit 91be24ae16
2 changed files with 14 additions and 3 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ from typing import NoReturn
from timezonefinder import TimezoneFinder
import cereal.messaging as messaging
from openpilot.common.time import system_time_valid
from openpilot.common.params import Params
from openpilot.common.swaglog import cloudlog
from openpilot.system.hardware import AGNOS
@@ -69,7 +70,8 @@ def main() -> NoReturn:
while True:
sm.update(1000)
msg = messaging.new_message('clocks', valid=True)
msg = messaging.new_message('clocks')
msg.valid = system_time_valid()
msg.clocks.wallTimeNanos = time.time_ns()
pm.send('clocks', msg)