From 09fe521cfeaacf63cb5d9e41487309c54d5f8a8b Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 4 May 2023 11:07:40 -0700 Subject: [PATCH] tizi: more amp retries (#28082) old-commit-hash: 9b0d140400381db831ab3f8c7d758bf446f10feb --- system/hardware/tici/amplifier.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/hardware/tici/amplifier.py b/system/hardware/tici/amplifier.py index 979bc757f6..5b656a40fa 100755 --- a/system/hardware/tici/amplifier.py +++ b/system/hardware/tici/amplifier.py @@ -124,12 +124,13 @@ class Amplifier: def set_configs(self, configs: List[AmpConfig]) -> bool: # retry in case panda is using the amp - for _ in range(10): + tries = 15 + for i in range(15): try: self._set_configs(configs) return True except OSError: - print("Failed to set amp config, retrying...") + print(f"Failed to set amp config, {tries - i - 1} retries left") time.sleep(0.02) return False