Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
Adeeb Shihadeh
2025-10-17 19:25:25 -07:00
committed by GitHub
parent 16f17ae0a1
commit f034faf0f1
3 changed files with 53 additions and 18 deletions

View File

@@ -117,6 +117,7 @@ class PandaSpiHandle(BaseHandle):
def __init__(self) -> None:
self.dev = SpiDevice()
self.no_retry = "NO_RETRY" in os.environ
# helpers
def _calc_checksum(self, data: bytes) -> int:
@@ -193,6 +194,8 @@ class PandaSpiHandle(BaseHandle):
except PandaSpiException as e:
exc = e
logger.debug("SPI transfer failed, retrying", exc_info=True)
if self.no_retry:
break
# ensure slave is in a consistent state and ready for the next transfer
# (e.g. slave TX buffer isn't stuck full)