mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-12-15 15:03:58 +01:00
Change method for scanning for card from poll, which is OK for USB-connected PN532, but causes 100% CPU usage with SPI-connected PN532
This commit is contained in:
parent
9b89a230c9
commit
91c0d72de6
3 changed files with 16 additions and 15 deletions
|
|
@ -127,8 +127,10 @@ class NFCScanner(object):
|
|||
e = threading.Event()
|
||||
e.wait(timeout=0.3)
|
||||
except NFCError, e:
|
||||
#this exception happens also when scanUID times out
|
||||
logging.debug("Failed to wait for RFID card: %s", e)
|
||||
#this exception happens also when scanUID finds no cards
|
||||
logging.debug("Failed to find RFID cards in reader's field: %s", e)
|
||||
e = threading.Event()
|
||||
e.wait(timeout=0.2)
|
||||
except KeyboardInterrupt:
|
||||
logging.info("Exiting on keyboard interrupt")
|
||||
self.nfc.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue