diff options
author | Gerhard Sittig <gerhard.sittig@gmx.net> | 2023-07-29 16:53:07 +0200 |
---|---|---|
committer | Gerhard Sittig <gerhard.sittig@gmx.net> | 2023-07-29 21:29:10 +0200 |
commit | 5e8090d7d30fb0915fc1b54f3ec098c69a417745 (patch) | |
tree | 78c907ef7ae9236aacca9f905153977aa215db4e /decoders/avr_pdi/__init__.py | |
parent | 6d1cde1daeea93b36c1c2c09e160e5b8042ef22b (diff) | |
download | libsigrokdecode-5e8090d7d30fb0915fc1b54f3ec098c69a417745.tar.gz libsigrokdecode-5e8090d7d30fb0915fc1b54f3ec098c69a417745.zip |
rgb_led_ws281x: rework the .decode() main loop, improve robustness
Concentrate timestamp gathering in the .decode() method, eliminate
instance members by using variables that are local to the method.
Finally use appropriate PD API v3 invocations. Use edge conditions plus
a counted 'skip' to detect the RESET pulse. Use a positive "check the
reset condition" logic, simplify the conditions which support the reset
pulse tracking, and which flush previously accumulated data when "the
bit time doesn't end" (the next edge is missing).
Improve robustness in those cases where captures use low oversampling
and similar length high and low pulses. The fixed (rather arbitrary?)
625us threshold resulted in several false last-bit values after the
API v3 conversion.
Heavily comment on this edge/pulse detection and timestamps logic,
since it's non-trivial and non-obvious. Keep all behaviour backwards
compatible before extending the feature set in future commits.
Diffstat (limited to 'decoders/avr_pdi/__init__.py')
0 files changed, 0 insertions, 0 deletions