summaryrefslogtreecommitdiff
path: root/decoders/can
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2014-03-09 23:48:27 +0100
committerBert Vermeulen <bert@biot.com>2014-03-10 00:47:30 +0100
commit84c1c0b52820af2418186ac3ecf93a5c6373a22e (patch)
treeae26f32b7c77646179369fcbe089b91e2c236665 /decoders/can
parentcfe46204d1c91f02d0e2c6679a2d15ff92bb90c8 (diff)
downloadlibsigrokdecode-84c1c0b52820af2418186ac3ecf93a5c6373a22e.tar.gz
libsigrokdecode-84c1c0b52820af2418186ac3ecf93a5c6373a22e.zip
Change PD options to be a tuple of dictionaries.
Each option consists of a dictionary with the following keys: id The option id, which is passed in when setting a value. desc A description of the option, suitable for display. def The default value for this option. values (optional) If present, a tuple containing values the option may take. They must be of the same type as the default. Valid types for the options are UTF-8-encoded strings, integers, and floating point values.
Diffstat (limited to 'decoders/can')
-rw-r--r--decoders/can/pd.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/decoders/can/pd.py b/decoders/can/pd.py
index c394cf1..e2b55fa 100644
--- a/decoders/can/pd.py
+++ b/decoders/can/pd.py
@@ -33,10 +33,10 @@ class Decoder(srd.Decoder):
{'id': 'can_rx', 'name': 'CAN RX', 'desc': 'CAN bus line'},
]
optional_probes = []
- options = {
- 'bitrate': ['Bitrate', 1000000], # 1Mbit/s
- 'sample_point': ['Sample point', 70], # 70%
- }
+ options = (
+ {'id': 'bitrate', 'desc': 'Bitrate', 'default': 1000000}, # 1Mbit/s
+ {'id': 'sample_point', 'desc': 'Sample point', 'default': 70}, # 70%
+ )
annotations = [
['data', 'CAN payload data'],
['sof', 'Start of frame'],