]> sigrok.org Git - libsigrokdecode.git/commitdiff
i2c: rephrase state machine, eliminate text matching
authorGerhard Sittig <redacted>
Mon, 17 Jul 2023 18:16:15 +0000 (20:16 +0200)
committerGerhard Sittig <redacted>
Tue, 18 Jul 2023 19:28:44 +0000 (21:28 +0200)
Rephrase the conditions which drive the I2C decoder's progress. Remove
self.state and its space separated string literals which were tedious to
search for, and which "lent themselves" to magic string matching. Use
other existing conditions instead, which also reduces redundancy.

Defer the "forgetting data bits" until after ACK was seen. Comment on
the motivation to keep the "protocol violating" implementation, which
misses error conditions that happen on the wire, but happens to support
heavily undersampled captures to an astonishing degree.

Also addresses minor style nits: Prefer to think of "dominant ACK" and
"recessive NAK". Rephrase a byte shift for the first address byte. Emit
the first warning annotation for the row which was declared before but
was not used so far.


No differences found