]> sigrok.org Git - libsigrokdecode.git/commitdiff
adf435x: Python list idioms in bits sequence accumulation
authorGerhard Sittig <redacted>
Fri, 30 Dec 2022 13:10:04 +0000 (14:10 +0100)
committerGerhard Sittig <redacted>
Mon, 9 Jan 2023 19:13:35 +0000 (20:13 +0100)
Use .extend() and .clear() for the Python list during accumulation of a
32bit word's bits sequence. This shall improve readability. Performance
is less of an issue since this decoder's data amount remains small
(32bit entities per SPI transfer).

Comment on the unexpected(?) SPI decoder's BITS ordering when passing
details up to stacked decoders. Raise and keep awareness for this
non-obvious implementation detail during decoder maintenance.

This implementation accumulates bits in the MSB order as they are sent
in SPI frames. Yet keeps the LSB bit order when a completely accumulated
32bit word gets inspected, to reduce the diff size. Bit field extraction
and annotation emission code paths assume a specific timestamp ordering.
The separation of transport and inspection also simplifies maintenance,
should a future SPI decoder provide BITS in their received order.


No differences found