summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2017-06-16 12:08:50 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-06-16 12:48:39 +0200
commit02760d3b6096ab5afb1a2cfb746fcb5540ccd4c5 (patch)
tree8627352bbb41a30f75ea667c12f1524ea325bc99 /decoders
parent37133b0acb35953176a777dc558e62c1c72ccaa9 (diff)
downloadlibsigrokdecode-02760d3b6096ab5afb1a2cfb746fcb5540ccd4c5.tar.gz
libsigrokdecode-02760d3b6096ab5afb1a2cfb746fcb5540ccd4c5.zip
dali: Convert to PD API version 3.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/dali/pd.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/decoders/dali/pd.py b/decoders/dali/pd.py
index f45306a..51d8284 100644
--- a/decoders/dali/pd.py
+++ b/decoders/dali/pd.py
@@ -24,7 +24,7 @@ class SamplerateError(Exception):
pass
class Decoder(srd.Decoder):
- api_version = 2
+ api_version = 3
id = 'dali'
name = 'DALI'
longname = 'Digital Addressable Lighting Interface'
@@ -196,12 +196,13 @@ class Decoder(srd.Decoder):
self.edges, self.bits, self.ss_es_bits = [], [], []
self.state = 'IDLE'
- def decode(self, ss, es, data):
+ def decode(self):
if not self.samplerate:
raise SamplerateError('Cannot decode without samplerate.')
bit = 0
- for (self.samplenum, pins) in data:
- self.dali = pins[0]
+ while True:
+ # TODO: Come up with more appropriate self.wait() conditions.
+ (self.dali,) = self.wait({'skip': 1})
if self.options['polarity'] == 'active-high':
self.dali ^= 1 # Invert.