Ran black, updated to pylint 2.x

This commit is contained in:
dherrada 2020-03-16 16:00:49 -04:00
parent d9b547eb5f
commit 129e02d563
10 changed files with 354 additions and 300 deletions

View file

@ -41,8 +41,10 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PN532.git"
import time
from adafruit_pn532.adafruit_pn532 import PN532, BusyError
class PN532_UART(PN532):
"""Driver for the PN532 connected over Serial UART"""
def __init__(self, uart, *, irq=None, reset=None, debug=False):
"""Create an instance of the PN532 class using Serial connection.
Optional IRQ pin (not used), reset pin and debugging output.
@ -54,7 +56,7 @@ class PN532_UART(PN532):
def _wakeup(self):
"""Send any special commands/data to wake up PN532"""
#self._write_frame([_HOSTTOPN532, _COMMAND_SAMCONFIGURATION, 0x01])
# self._write_frame([_HOSTTOPN532, _COMMAND_SAMCONFIGURATION, 0x01])
self.SAM_configuration()
def _wait_ready(self, timeout=1):
@ -75,7 +77,11 @@ class PN532_UART(PN532):
def _write_data(self, framebytes):
"""Write a specified count of bytes to the PN532"""
while self._uart.read(1): # this would be a lot nicer if we could query the # of bytes
while self._uart.read(
1
): # this would be a lot nicer if we could query the # of bytes
pass
self._uart.write('\x55\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') # wake up!
self._uart.write(
"\x55\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
) # wake up!
self._uart.write(framebytes)