We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 949a5c6 + 5c75384 commit b949e87Copy full SHA for b949e87
adafruit_pn532/spi.py
@@ -81,14 +81,14 @@ def _wait_ready(self, timeout=1):
81
status = bytearray([reverse_bit(_SPI_STATREAD), 0])
82
83
timestamp = time.monotonic()
84
- while (time.monotonic() - timestamp) < timeout:
85
- with self._spi as spi:
+ with self._spi as spi:
+ while (time.monotonic() - timestamp) < timeout:
86
time.sleep(0.02) # required
87
spi.write_readinto(status, status) #pylint: disable=no-member
88
- if reverse_bit(status[1]) == 0x01: # LSB data is read in MSB
89
- return True # Not busy anymore!
90
- else:
91
- time.sleep(0.01) # pause a bit till we ask again
+ if reverse_bit(status[1]) == 0x01: # LSB data is read in MSB
+ return True # Not busy anymore!
+ else:
+ time.sleep(0.01) # pause a bit till we ask again
92
# We timed out!
93
return False
94
0 commit comments