From 4a0b5dacbb40bc20a3583be795756b5c23f13b91 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 14 Jun 2023 21:42:33 -0700 Subject: [PATCH] pandad: update time from RTC (#28466) * pandad: update time from RTC * Update pandad.py --------- Co-authored-by: Comma Device --- selfdrive/boardd/pandad.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/boardd/pandad.py b/selfdrive/boardd/pandad.py index 859a30a1b..6ab6d05b0 100755 --- a/selfdrive/boardd/pandad.py +++ b/selfdrive/boardd/pandad.py @@ -10,6 +10,7 @@ from functools import cmp_to_key from panda import Panda, PandaDFU, FW_PATH from common.basedir import BASEDIR from common.params import Params +from selfdrive.boardd.set_time import set_time from system.hardware import HARDWARE from system.swaglog import cloudlog @@ -133,6 +134,11 @@ def main() -> NoReturn: cloudlog.event("heartbeat lost", deviceState=health, serial=panda.get_usb_serial()) if first_run: + if panda.is_internal(): + # update time from RTC + set_time(cloudlog) + + # reset panda to ensure we're in a good state cloudlog.info(f"Resetting panda {panda.get_usb_serial()}") if panda.is_internal(): HARDWARE.reset_internal_panda()