]> sigrok.org Git - libsigrokdecode.git/commitdiff
i2c: improve reliability of bitrate estimation (throughput, meta)
authorGerhard Sittig <redacted>
Mon, 17 Jul 2023 16:37:37 +0000 (18:37 +0200)
committerGerhard Sittig <redacted>
Tue, 18 Jul 2023 19:09:40 +0000 (21:09 +0200)
The I2C decoder used to track the bitrate of the observed traffic
(number of address and data bits in a transfer). It's uncertain where
this output went (is meta still supported, are applications using it?),
and it appears to not be covered in tests. Improve the logic still.

Adjust the location of the emitted annotation. It used to start at the
most recently observed data byte, which looks suspicious. Output was
attempted when STOP was seen, even if the start was not observed. The
calculation dropped data before a repeated start. The implementation
kept data around after it became obsolete.

Break a long formula across several text lines. Use the fact that Python
division yields floating point results.

Add a comment in the ACK/NAK bit handler. It references data which was
gathered when accumulating data bits. Could be acceptable but must be
remained aware of.


No differences found