+ def _reset(self):
+ self._hid_xfer(bytes([self.SYS_RESET]), False)
+ time.sleep(PICO_U2IF_RESET_DELAY)
+ start = time.monotonic()
+ while time.monotonic() - start < 5:
+ try:
+ self._hid.open(Pico_u2if.VID, Pico_u2if.PID)
+ except OSError:
+ time.sleep(0.1)
+ continue
+ return
+ raise OSError("Pico open error.")
+