Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions adafruit_bluefruitspi.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ class BluefruitSPI:
"""Helper for the Bluefruit LE SPI Friend"""

def __init__(
self, spi, cs, irq, reset, debug=False, fifo_len=20
self,
spi,
cs, # pylint: disable=invalid-name
irq,
reset,
debug=False,
fifo_len=20,
): # pylint: disable=too-many-arguments
self._irq = irq
self._buf_tx = bytearray(20)
Expand Down Expand Up @@ -376,7 +382,7 @@ def read_packet(self): # pylint: disable=too-many-return-statements
packet = self._buffer[0:plen]

self._buffer = self._buffer[plen:] # remove packet from buffer
if sum([ord(x) for x in packet]) % 256 != 255: # check sum
if sum(ord(x) for x in packet) % 256 != 255: # check sum
return None

# OK packet's good!
Expand Down