summaryrefslogtreecommitdiff
path: root/decoders/dcf77/dcf77.py
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-03-04 10:13:29 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2012-03-04 15:10:11 +0100
commit2b7160383cc189f721600c04be17a980e216dfd6 (patch)
tree69384f69ed902b7eb306ad929f9d16b233e5b579 /decoders/dcf77/dcf77.py
parent09059016e02db5d83b4862a3adcf8ddf101f6991 (diff)
downloadlibsigrokdecode-2b7160383cc189f721600c04be17a980e216dfd6.tar.gz
libsigrokdecode-2b7160383cc189f721600c04be17a980e216dfd6.zip
srd: PDs: Use strings for states, too.
Diffstat (limited to 'decoders/dcf77/dcf77.py')
-rw-r--r--decoders/dcf77/dcf77.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/decoders/dcf77/dcf77.py b/decoders/dcf77/dcf77.py
index ab600ed..eabceee 100644
--- a/decoders/dcf77/dcf77.py
+++ b/decoders/dcf77/dcf77.py
@@ -23,10 +23,6 @@
import sigrokdecode as srd
import calendar
-# States
-WAIT_FOR_RISING_EDGE = 0
-GET_BIT = 1
-
# Annotation feed formats
ANN_ASCII = 0
@@ -57,7 +53,7 @@ class Decoder(srd.Decoder):
]
def __init__(self, **kwargs):
- self.state = WAIT_FOR_RISING_EDGE
+ self.state = 'WAIT FOR RISING EDGE'
self.oldval = None
self.samplenum = 0
self.bit_start = 0
@@ -208,7 +204,7 @@ class Decoder(srd.Decoder):
self.samplenum += 1 # FIXME. Use samplenum. Off-by-one?
- if self.state == WAIT_FOR_RISING_EDGE:
+ if self.state == 'WAIT FOR RISING EDGE':
# Wait until the next rising edge occurs.
if not (self.oldval == 0 and val == 1):
self.oldval = val
@@ -262,7 +258,7 @@ class Decoder(srd.Decoder):
self.handle_dcf77_bit(bit)
self.bitcount += 1
- self.state = WAIT_FOR_RISING_EDGE
+ self.state = 'WAIT FOR RISING EDGE'
else:
raise Exception('Invalid state: %d' % self.state)