mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
PandaDFU: retry SPI comms (#1348)
* retry * set exc --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -421,7 +421,7 @@ class Panda:
|
||||
except Exception:
|
||||
logging.debug("reconnecting is taking %d seconds...", i + 1)
|
||||
try:
|
||||
dfu = PandaDFU(PandaDFU.st_serial_to_dfu_serial(self._serial, self._mcu_type))
|
||||
dfu = PandaDFU(self.get_dfu_serial())
|
||||
dfu.recover()
|
||||
except Exception:
|
||||
pass
|
||||
@@ -493,7 +493,7 @@ class Panda:
|
||||
self.reconnect()
|
||||
|
||||
def recover(self, timeout: Optional[int] = None, reset: bool = True) -> bool:
|
||||
dfu_serial = PandaDFU.st_serial_to_dfu_serial(self._serial, self._mcu_type)
|
||||
dfu_serial = self.get_dfu_serial()
|
||||
|
||||
if reset:
|
||||
self.reset(enter_bootstub=True)
|
||||
@@ -677,6 +677,9 @@ class Panda:
|
||||
"""
|
||||
return self._serial
|
||||
|
||||
def get_dfu_serial(self):
|
||||
return PandaDFU.st_serial_to_dfu_serial(self._serial, self._mcu_type)
|
||||
|
||||
def get_uid(self):
|
||||
"""
|
||||
Returns the UID from the MCU
|
||||
|
||||
Reference in New Issue
Block a user