mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
tizi: fix panda amp race condition (#33895)
* backoff * bump panda * cleanup * fix mypy --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
+1
-1
Submodule panda updated: 352e7ff138...0b364ece1e
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user