linter said knock you out

This commit is contained in:
caternuson 2018-08-28 13:21:44 -07:00
parent 2049c36984
commit 97b5c5c5d6
2 changed files with 7 additions and 4 deletions

View file

@ -38,11 +38,13 @@ __version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PN532.git" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PN532.git"
import time import time
from adafruit_pn532.adafruit_pn532 import PN532
import adafruit_bus_device.i2c_device as i2c_device import adafruit_bus_device.i2c_device as i2c_device
from digitalio import Direction
from adafruit_pn532.adafruit_pn532 import PN532, BusyError, _reset
from micropython import const from micropython import const
# pylint: disable=bad-whitespace
_I2C_ADDRESS = const(0x24) _I2C_ADDRESS = const(0x24)
class PN532_I2C(PN532): class PN532_I2C(PN532):
@ -96,7 +98,7 @@ class PN532_I2C(PN532):
with self._i2c as i2c: with self._i2c as i2c:
i2c.readinto(frame, end=1) # read status byte! i2c.readinto(frame, end=1) # read status byte!
if frame[0] != 0x01: # not ready if frame[0] != 0x01: # not ready
raise pn532.BusyError raise BusyError
i2c.readinto(frame) # ok get the data, plus statusbyte i2c.readinto(frame) # ok get the data, plus statusbyte
if self.debug: if self.debug:
print("Reading: ", [hex(i) for i in frame[1:]]) print("Reading: ", [hex(i) for i in frame[1:]])
@ -107,4 +109,4 @@ class PN532_I2C(PN532):
def _write_data(self, framebytes): def _write_data(self, framebytes):
"""Write a specified count of bytes to the PN532""" """Write a specified count of bytes to the PN532"""
with self._i2c as i2c: with self._i2c as i2c:
i2c.write(framebytes) i2c.write(framebytes)

View file

@ -38,11 +38,12 @@ __version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PN532.git" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PN532.git"
import time import time
from adafruit_pn532.adafruit_pn532 import PN532
import adafruit_bus_device.spi_device as spi_device import adafruit_bus_device.spi_device as spi_device
from adafruit_pn532.adafruit_pn532 import PN532
from micropython import const from micropython import const
# pylint: disable=bad-whitespace
_SPI_STATREAD = const(0x02) _SPI_STATREAD = const(0x02)
_SPI_DATAWRITE = const(0x01) _SPI_DATAWRITE = const(0x01)
_SPI_DATAREAD = const(0x03) _SPI_DATAREAD = const(0x03)