mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
Removed redundant weakref references
Also tweaked a couple of minor bits (SPI bus init mask) and unused _get_address override
This commit is contained in:
@@ -64,9 +64,14 @@ class SPISoftwareBus(SharedMixin, Device):
|
||||
"""
|
||||
result = []
|
||||
with self.lock:
|
||||
shift = operator.lshift if lsb_first else operator.rshift
|
||||
if lsb_first:
|
||||
shift = operator.lshift
|
||||
init_mask = 1
|
||||
else:
|
||||
shift = operator.rshift
|
||||
init_mask = 1 << (bits_per_word - 1)
|
||||
for write_word in data:
|
||||
mask = 1 if lsb_first else 1 << (bits_per_word - 1)
|
||||
mask = init_mask
|
||||
read_word = 0
|
||||
for _ in range(bits_per_word):
|
||||
if self.mosi is not None:
|
||||
|
||||
Reference in New Issue
Block a user