diff options
author | Gerhard Sittig <gerhard.sittig@gmx.net> | 2020-07-02 19:12:37 +0200 |
---|---|---|
committer | Gerhard Sittig <gerhard.sittig@gmx.net> | 2020-07-02 19:12:37 +0200 |
commit | 0fb7ce22ec8641ef68b6805259ee84cf4c88a084 (patch) | |
tree | ea02d1a723aedc4dbc08aa3c06e7b9bcd94c60ff /decoders/pjdl | |
parent | 12bbd67047b5ec024feeea2faef998336cfa043f (diff) | |
download | libsigrokdecode-0fb7ce22ec8641ef68b6805259ee84cf4c88a084.tar.gz libsigrokdecode-0fb7ce22ec8641ef68b6805259ee84cf4c88a084.zip |
pjdl: prepare for "stretched" timings
Since the spec is vague on the subject, and real world captures were
found to occassionally run on odd clocks, internally prepare to inspect
traffic and interpret its content although the input data is invalid in
the strictest sense. Keep this hack internal, don't suggest to users
that invalid traffic would be perfectly acceptable.
Diffstat (limited to 'decoders/pjdl')
-rw-r--r-- | decoders/pjdl/pd.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/decoders/pjdl/pd.py b/decoders/pjdl/pd.py index 5a61a2f..11f72ab 100644 --- a/decoders/pjdl/pd.py +++ b/decoders/pjdl/pd.py @@ -387,7 +387,9 @@ class Decoder(srd.Decoder): # for bit widths (tolerance margin). # Get times in microseconds. - self.data_width, self.pad_width = self.mode_times[self.options['mode']] + mode_times = self.mode_times[self.options['mode']] + mode_times = [t * 1.0 for t in mode_times] + self.data_width, self.pad_width = mode_times self.byte_width = self.pad_width + 9 * self.data_width self.add_idle_width = self.options['idle_add_us'] self.idle_width = self.byte_width + self.add_idle_width |