Merge branch 'master' into pylint-update
This commit is contained in:
commit
18858f7604
4 changed files with 10 additions and 9 deletions
|
@ -195,11 +195,11 @@ class PN532:
|
|||
|
||||
try:
|
||||
self._wakeup()
|
||||
self.get_firmware_version() # first time often fails, try 2ce
|
||||
_ = self.firmware_version # first time often fails, try 2ce
|
||||
return
|
||||
except (BusyError, RuntimeError):
|
||||
pass
|
||||
self.get_firmware_version()
|
||||
_ = self.firmware_version
|
||||
|
||||
def _read_data(self, count):
|
||||
# Read raw data from device, not including status bytes:
|
||||
|
@ -322,7 +322,8 @@ class PN532:
|
|||
# Return response data.
|
||||
return response[2:]
|
||||
|
||||
def get_firmware_version(self):
|
||||
@property
|
||||
def firmware_version(self):
|
||||
"""Call PN532 GetFirmwareVersion function and return a tuple with the IC,
|
||||
Ver, Rev, and Support values.
|
||||
"""
|
||||
|
|
|
@ -64,8 +64,8 @@ pn532 = PN532_I2C(i2c, debug=False)
|
|||
# uart = busio.UART(board.TX, board.RX, baudrate=115200, timeout=100)
|
||||
# pn532 = PN532_UART(uart, debug=False)
|
||||
|
||||
ic, ver, rev, support = pn532.get_firmware_version()
|
||||
print("Found PN532 with firmware version: {0}.{1}".format(ver, rev))
|
||||
ic, ver, rev, support = pn532.firmware_version
|
||||
print('Found PN532 with firmware version: {0}.{1}'.format(ver, rev))
|
||||
|
||||
# Configure PN532 to communicate with MiFare cards
|
||||
pn532.SAM_configuration()
|
||||
|
|
|
@ -60,8 +60,8 @@ pn532 = PN532_SPI(spi, cs_pin, debug=False)
|
|||
# uart = busio.UART(board.TX, board.RX, baudrate=115200, timeout=100)
|
||||
# pn532 = PN532_UART(uart, debug=False)
|
||||
|
||||
ic, ver, rev, support = pn532.get_firmware_version()
|
||||
print("Found PN532 with firmware version: {0}.{1}".format(ver, rev))
|
||||
ic, ver, rev, support = pn532.firmware_version
|
||||
print('Found PN532 with firmware version: {0}.{1}'.format(ver, rev))
|
||||
|
||||
# Configure PN532 to communicate with MiFare cards
|
||||
pn532.SAM_configuration()
|
||||
|
|
|
@ -40,8 +40,8 @@ pn532 = PN532_I2C(i2c, debug=False, reset=reset_pin, req=req_pin)
|
|||
# uart = busio.UART(board.TX, board.RX, baudrate=115200, timeout=100)
|
||||
# pn532 = PN532_UART(uart, debug=False)
|
||||
|
||||
ic, ver, rev, support = pn532.get_firmware_version()
|
||||
print("Found PN532 with firmware version: {0}.{1}".format(ver, rev))
|
||||
ic, ver, rev, support = pn532.firmware_version
|
||||
print('Found PN532 with firmware version: {0}.{1}'.format(ver, rev))
|
||||
|
||||
# Configure PN532 to communicate with MiFare cards
|
||||
pn532.SAM_configuration()
|
||||
|
|
Loading…
Reference in a new issue