tizi: fix panda amp race condition (#33895)

* backoff

* bump panda

* cleanup

* fix mypy

---------

Co-authored-by: Comma Device <device@comma.ai>
pull/33896/head
Adeeb Shihadeh 6 months ago committed by GitHub
parent b470bef140
commit 25d2555e49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      panda
  2. 6
      system/hardware/tici/amplifier.py

@ -1 +1 @@
Subproject commit 352e7ff138e9706715c8f0b76a985751ac620ae3
Subproject commit 0b364ece1eafa2e66b71be7cade3fdfb56a3014e

@ -125,13 +125,15 @@ class Amplifier:
def set_configs(self, configs: list[AmpConfig]) -> bool:
# retry in case panda is using the amp
tries = 15
for i in range(15):
backoff = 0.
for i in range(tries):
try:
self._set_configs(configs)
return True
except OSError:
backoff += 0.1
time.sleep(backoff)
print(f"Failed to set amp config, {tries - i - 1} retries left")
time.sleep(0.02)
return False
def set_global_shutdown(self, amp_disabled: bool) -> bool:

Loading…
Cancel
Save