From 2d9e1115baa6a5806e4ecfa435cc06395afc2337 Mon Sep 17 00:00:00 2001 From: Stephan Thiele Date: Wed, 17 Apr 2019 20:04:22 +0200 Subject: can: introduce fast bitrate --- decoders/can/pd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'decoders/can') 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. -- cgit v1.2.3-70-g09d2