From dd95035331818633e0a7e35a8af2eeb0fe843b11 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Wed, 14 Jun 2023 18:43:17 +0800 Subject: [PATCH] Fix: The CAN decoder AND CAN_FD --- lang/cn/dec/a.json | 10 +++++++++- libsigrokdecode4DSL/decoders/can-fd/pd.py | 8 ++++---- libsigrokdecode4DSL/decoders/can/pd.py | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lang/cn/dec/a.json b/lang/cn/dec/a.json index 4023a714..de8324b0 100644 --- a/lang/cn/dec/a.json +++ b/lang/cn/dec/a.json @@ -141,7 +141,15 @@ }, { "id": "dec_can_opt_bitrate", - "text": "比特率" + "text": "波特率" + }, + { + "id": "dec_can_opt_nominal_bitrate", + "text": "低波特率" + }, + { + "id": "dec_can_opt_fast_bitrate", + "text": "高波特率" }, { "id": "dec_can_opt_sample_point", diff --git a/libsigrokdecode4DSL/decoders/can-fd/pd.py b/libsigrokdecode4DSL/decoders/can-fd/pd.py index 11f72175..4e7d248b 100644 --- a/libsigrokdecode4DSL/decoders/can-fd/pd.py +++ b/libsigrokdecode4DSL/decoders/can-fd/pd.py @@ -39,12 +39,12 @@ class Decoder(srd.Decoder): outputs = ['can'] tags = ['Automotive'] channels = ( - {'id': 'can_rx', 'name': 'CAN FD', 'desc': 'CAN FD bus line', 'idn':'dec_can_fd_chan_can_rx'}, + {'id': 'can_rx', 'name': 'CAN FD', 'desc': 'CAN FD bus line', 'idn':'dec_can_chan_can_rx'}, ) options = ( - {'id': 'nominal_bitrate', 'desc': 'Nominal bitrate (bits/s)', 'default': 1000000, 'idn':'dec_can_fd_opt_nominal_bitrate'}, - {'id': 'fast_bitrate', 'desc': 'Fast bitrate (bits/s)', 'default': 2000000, 'idn':'dec_can_fd_opt_fast_bitrate'}, - {'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0, 'idn':'dec_can_fd_opt_sample_point'}, + {'id': 'nominal_bitrate', 'desc': 'Nominal bitrate (bits/s)', 'default': 1000000, 'idn':'dec_can_opt_nominal_bitrate'}, + {'id': 'fast_bitrate', 'desc': 'Fast bitrate (bits/s)', 'default': 2000000, 'idn':'dec_can_opt_fast_bitrate'}, + {'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0, 'idn':'dec_can_opt_sample_point'}, ) annotations = ( ('data', 'CAN payload data'), diff --git a/libsigrokdecode4DSL/decoders/can/pd.py b/libsigrokdecode4DSL/decoders/can/pd.py index 2e4d8597..cf694573 100644 --- a/libsigrokdecode4DSL/decoders/can/pd.py +++ b/libsigrokdecode4DSL/decoders/can/pd.py @@ -42,8 +42,8 @@ class Decoder(srd.Decoder): {'id': 'can_rx', 'name': 'CAN', 'desc': 'CAN bus line', 'idn':'dec_can_chan_can_rx'}, ) options = ( - {'id': 'bitrate', 'desc': 'bitrate (bits/s)', 'default': 1000000,'idn':'dec_can_opt_bitrate'}, - {'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0,'idn':'dec_can_opt_sample_point'}, + {'id': 'bitrate', 'desc': 'bitrate (bits/s)', 'default': 1000000,'idn':'dec_can_opt_bitrate'}, + {'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0,'idn':'dec_can_opt_sample_point'}, ) annotations = ( ('data', 'CAN payload data'),