summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorVesa-Pekka Palmu <vpalmu@depili.fi>2022-12-26 19:00:56 +0200
committerGerhard Sittig <gerhard.sittig@gmx.net>2023-01-09 20:10:24 +0100
commit53cbedf5852028f54891066b0a5e698c4dd0c42a (patch)
treeb846c39e02fffe2d860c277feecdc118d1e43996 /decoders
parent02cc30befa2d5cdfa1d1c214012490332a88a333 (diff)
downloadlibsigrokdecode-53cbedf5852028f54891066b0a5e698c4dd0c42a.tar.gz
libsigrokdecode-53cbedf5852028f54891066b0a5e698c4dd0c42a.zip
adf435x: Clean up SPI data input
Avoid generic variable names. Only unpack parameters which are provided by the lower layer decoder after the stacked decoder checked their type and is aware of their meaning.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/adf435x/pd.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/decoders/adf435x/pd.py b/decoders/adf435x/pd.py
index c60ed4e..3cc74b6 100644
--- a/decoders/adf435x/pd.py
+++ b/decoders/adf435x/pd.py
@@ -126,10 +126,11 @@ class Decoder(srd.Decoder):
def decode(self, ss, es, data):
- ptype, data1, data2 = data
+ ptype, _, _ = data
if ptype == 'CS-CHANGE':
- if data1 == 1:
+ _, cs_before, cs_after = data
+ if cs_before == 1:
if len(self.bits) == 32:
reg_value, reg_pos = self.decode_bits(0, 3)
self.put(reg_pos[0], reg_pos[1], self.out_ann, [ANN_REG,
@@ -141,4 +142,5 @@ class Decoder(srd.Decoder):
field = self.decode_field(*field_desc)
self.bits = []
if ptype == 'BITS':
- self.bits = data1 + self.bits
+ _, mosi_bits, miso_bits = data
+ self.bits = mosi_bits + self.bits