From: Stephan Thiele Date: Wed, 17 Apr 2019 18:04:22 +0000 (+0200) Subject: can: introduce fast bitrate X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2d9e1115baa6a5806e4ecfa435cc06395afc2337;p=libsigrokdecode.git can: introduce fast bitrate --- diff --git a/decoders/can/pd.py b/decoders/can/pd.py index 8c417fd..5d27b28 100644 --- a/decoders/can/pd.py +++ b/decoders/can/pd.py @@ -37,7 +37,8 @@ class Decoder(srd.Decoder): {'id': 'can_rx', 'name': 'CAN RX', 'desc': 'CAN bus line'}, ) options = ( - {'id': 'bitrate', 'desc': 'Bitrate (bits/s)', 'default': 1000000}, + {'id': 'nominal_bitrate', 'desc': 'Nominal Bitrate (bits/s)', 'default': 1000000}, + {'id': 'fast_bitrate', 'desc': 'Fast Bitrate (bits/s)', 'default': 2000000}, {'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0}, ) annotations = ( @@ -82,7 +83,7 @@ class Decoder(srd.Decoder): def metadata(self, key, value): if key == srd.SRD_CONF_SAMPLERATE: self.samplerate = value - self.bit_width = float(self.samplerate) / float(self.options['bitrate']) + self.bit_width = float(self.samplerate) / float(self.options['nominal_bitrate']) self.sample_point = (self.bit_width / 100.0) * self.options['sample_point'] # Generic helper for CAN bit annotations.