speed up by checking i2c busy byte
This commit is contained in:
parent
29679ba8a3
commit
aa36758493
1 changed files with 1 additions and 6 deletions
|
@ -262,17 +262,12 @@ class PN532_I2C(object):
|
||||||
status = bytearray(1)
|
status = bytearray(1)
|
||||||
t = time.monotonic()
|
t = time.monotonic()
|
||||||
while (time.monotonic() - t) < timeout:
|
while (time.monotonic() - t) < timeout:
|
||||||
"""
|
|
||||||
with self._i2c:
|
with self._i2c:
|
||||||
self._i2c.readinto(status)
|
self._i2c.readinto(status)
|
||||||
if status == b'\0x01':
|
if status == b'\x01':
|
||||||
print(".ready.")
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print(".busy.")
|
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
"""
|
|
||||||
time.sleep(timeout)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def call_function(self, command, response_length=0, params=[], timeout=1):
|
def call_function(self, command, response_length=0, params=[], timeout=1):
|
||||||
|
|
Loading…
Reference in a new issue