mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
timed: set valid flag (#32061)
* timed: set valid flag * oops old-commit-hash: 43832335b8e44e40683ffe6afa226a2d2de0d6ff
This commit is contained in:
+3
-1
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user