|
|
@ -124,12 +124,13 @@ class Amplifier: |
|
|
|
|
|
|
|
|
|
|
|
def set_configs(self, configs: List[AmpConfig]) -> bool: |
|
|
|
def set_configs(self, configs: List[AmpConfig]) -> bool: |
|
|
|
# retry in case panda is using the amp |
|
|
|
# retry in case panda is using the amp |
|
|
|
for _ in range(10): |
|
|
|
tries = 15 |
|
|
|
|
|
|
|
for i in range(15): |
|
|
|
try: |
|
|
|
try: |
|
|
|
self._set_configs(configs) |
|
|
|
self._set_configs(configs) |
|
|
|
return True |
|
|
|
return True |
|
|
|
except OSError: |
|
|
|
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) |
|
|
|
time.sleep(0.02) |
|
|
|
return False |
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|