X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fdcf77%2Fdcf77.py;h=d8b9d3b1988151feab3e417b5a3c664ee33fd94e;hb=122e9a90a54e034b93f554938896983d293edec1;hp=098c3b90b9d9951774b4db6a8aa827886a8932d3;hpb=b77614bc977475102062ac5d1c8fe8e55349315a;p=libsigrokdecode.git diff --git a/decoders/dcf77/dcf77.py b/decoders/dcf77/dcf77.py index 098c3b9..d8b9d3b 100644 --- a/decoders/dcf77/dcf77.py +++ b/decoders/dcf77/dcf77.py @@ -18,25 +18,11 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# # DCF77 protocol decoder -# -# More information: -# http://en.wikipedia.org/wiki/DCF77 -# - -# -# Protocol output format: -# TODO -# import sigrokdecode as srd import calendar -# States -WAIT_FOR_RISING_EDGE = 0 -GET_BIT = 1 - # Annotation feed formats ANN_ASCII = 0 @@ -50,7 +36,6 @@ class Decoder(srd.Decoder): name = 'DCF77' longname = 'DCF77 time protocol' desc = 'TODO.' - longdesc = 'TODO.' license = 'gplv2+' inputs = ['logic'] outputs = ['dcf77'] @@ -67,7 +52,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 @@ -218,7 +203,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 @@ -272,7 +257,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)