From 5553f30a571df7a47a02410f8b0634113b0ccf2b Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 6 Jun 2021 16:20:39 -0700 Subject: [PATCH] small pandad speedup (#21168) old-commit-hash: f37731b06d083740444a9988152842bb5faea298 --- selfdrive/pandad.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/selfdrive/pandad.py b/selfdrive/pandad.py index 27e3aa261f..7e998bb91f 100755 --- a/selfdrive/pandad.py +++ b/selfdrive/pandad.py @@ -18,7 +18,7 @@ def get_expected_signature() -> bytes: return b"" -def update_panda() -> None: +def update_panda() -> Panda: panda = None panda_dfu = None @@ -77,12 +77,13 @@ def update_panda() -> None: cloudlog.info("Version mismatch after flashing, exiting") raise AssertionError + return panda + def main() -> None: - update_panda() + panda = update_panda() - # check heatlh for lost heartbeat - panda = Panda() + # check health for lost heartbeat health = panda.health() if health["heartbeat_lost"]: cloudlog.event("heartbeat lost", deviceState=health)