Skip to content

Commit c87079b

Browse files
committed
change timeout to retry count in _wait_spi_char
1 parent d3e7a58 commit c87079b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

adafruit_esp32spi/adafruit_esp32spi.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,8 @@ def _read_bytes(self, spi, buffer, start=0, end=None):
260260
print("\t\tRead:", [hex(i) for i in buffer])
261261

262262
def _wait_spi_char(self, spi, desired):
263-
"""Read a byte with a time-out, and if we get it, check that its what we expect"""
264-
times = time.monotonic()
265-
while (time.monotonic() - times) < 0.1:
263+
"""Read a byte with a retry loop, and if we get it, check that its what we expect"""
264+
for _ in range(50):
266265
r = self._read_byte(spi)
267266
if r == _ERR_CMD:
268267
raise RuntimeError("Error response to command")

0 commit comments

Comments
 (0)