pandad: update time from RTC (#28466)

* pandad: update time from RTC

* Update pandad.py

---------

Co-authored-by: Comma Device <device@comma.ai>
pull/28437/head
Adeeb Shihadeh 2 years ago committed by GitHub
parent 6d25f66cf1
commit 4a0b5dacbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      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()

Loading…
Cancel
Save