From: Uwe Hermann Date: Tue, 8 May 2012 21:53:48 +0000 (+0200) Subject: srd: Remove TODOs from annotation format names. X-Git-Tag: libsigrokdecode-0.1.1~122 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=ee3e279c7558b388410d16cbce9db6c80e9c0c67 srd: Remove TODOs from annotation format names. Also, fix minor consistency issues, cosmetics, typos. --- diff --git a/decoders/dcf77/dcf77.py b/decoders/dcf77/dcf77.py index 573888f..a02eb32 100644 --- a/decoders/dcf77/dcf77.py +++ b/decoders/dcf77/dcf77.py @@ -24,7 +24,7 @@ import sigrokdecode as srd import calendar # Annotation feed formats -ANN_ASCII = 0 +ANN_TEXT = 0 # Return the specified BCD number (max. 8 bits) as integer. def bcd2int(b): @@ -47,8 +47,8 @@ class Decoder(srd.Decoder): ] options = {} annotations = [ - # ANN_ASCII - ['ASCII', 'TODO: description'], + # ANN_TEXT + ['Text', 'Human-readable text'], ] def __init__(self, **kwargs): diff --git a/decoders/i2cfilter/i2cfilter.py b/decoders/i2cfilter/i2cfilter.py index 6b3d113..fad11c3 100644 --- a/decoders/i2cfilter/i2cfilter.py +++ b/decoders/i2cfilter/i2cfilter.py @@ -30,10 +30,13 @@ class Decoder(srd.Decoder): license = 'gplv3+' inputs = ['i2c'] outputs = [] + probes = [] + optional_probes = [] options = { 'address': ['Address to filter out of the I2C stream', 0], 'direction': ['Direction to filter (read/write)', ''] } + annotations = [] def __init__(self, **kwargs): self.state = None diff --git a/decoders/i2s/i2s.py b/decoders/i2s/i2s.py index d627ebb..b81f2dd 100644 --- a/decoders/i2s/i2s.py +++ b/decoders/i2s/i2s.py @@ -38,10 +38,12 @@ class Decoder(srd.Decoder): probes = [ {'id': 'sck', 'name': 'SCK', 'desc': 'Bit clock line'}, {'id': 'ws', 'name': 'WS', 'desc': 'Word select line'}, - {'id': 'sd', 'name': 'SD', 'desc': 'Serial Data line'}, + {'id': 'sd', 'name': 'SD', 'desc': 'Serial data line'}, ] + optional_probes = [] + options = {} annotations = [ - ['ASCII', 'Annotations in ASCII format'], + ['Hex', 'Annotations in hex format'], ] def __init__(self, **kwargs): @@ -62,12 +64,12 @@ class Decoder(srd.Decoder): def report(self): - # Calculate the sample rate + # Calculate the sample rate. samplerate = '?' if self.start_sample != None and \ self.first_sample != None and \ self.start_sample > self.first_sample: - samplerate = "%d" % (self.samplesreceived * + samplerate = '%d' % (self.samplesreceived * self.samplerate / (self.start_sample - self.first_sample)) @@ -82,26 +84,26 @@ class Decoder(srd.Decoder): continue self.oldsck = sck - if sck == 0: # Ignore the falling clock edge + if sck == 0: # Ignore the falling clock edge. continue self.data = (self.data << 1) | sd self.bitcount += 1 - # This was not the LSB unless WS has flipped + # This was not the LSB unless WS has flipped. if ws == self.oldws: continue - # Only submit the sample, if we received the beginning of it + # Only submit the sample, if we received the beginning of it. if self.start_sample != None: self.samplesreceived += 1 self.put(self.start_sample, self.samplenum, self.out_proto, - ['data', self.data]) + ['data', self.data]) self.put(self.start_sample, self.samplenum, self.out_ann, - [ANN_HEX, ['%s: 0x%08x' % ('L' if self.oldws else 'R', - self.data)]]) + [ANN_HEX, ['%s: 0x%08x' % ('L' if self.oldws else 'R', + self.data)]]) - # Check that the data word was the correct length + # Check that the data word was the correct length. if self.wordlength != -1 and self.wordlength != self.bitcount: self.put(self.start_sample, self.samplenum, self.out_ann, [ANN_HEX, ['WARNING: Received a %d-bit word, when a ' @@ -115,9 +117,9 @@ class Decoder(srd.Decoder): self.bitcount = 0 self.start_sample = self.samplenum - # Save the first sample position + # Save the first sample position. if self.first_sample == None: self.first_sample = self.samplenum self.oldws = ws - \ No newline at end of file + diff --git a/decoders/jtag/jtag.py b/decoders/jtag/jtag.py index df16d2b..d2568ab 100644 --- a/decoders/jtag/jtag.py +++ b/decoders/jtag/jtag.py @@ -43,7 +43,7 @@ class Decoder(srd.Decoder): ] options = {} annotations = [ - ['ASCII', 'TODO: description'], + ['Text', 'Human-readable text'], ] def __init__(self, **kwargs): diff --git a/decoders/lpc/lpc.py b/decoders/lpc/lpc.py index 9bc91cd..1357fbd 100644 --- a/decoders/lpc/lpc.py +++ b/decoders/lpc/lpc.py @@ -22,9 +22,6 @@ import sigrokdecode as srd -# Annotation feed formats -ANN_ASCII = 0 - # ... fields = { # START field (indicates start or stop of a transaction) @@ -128,7 +125,7 @@ class Decoder(srd.Decoder): ] options = {} annotations = [ - ['ASCII', 'TODO: description'], + ['Text', 'Human-readable text'], ] def __init__(self, **kwargs): diff --git a/decoders/mx25lxx05d/mx25lxx05d.py b/decoders/mx25lxx05d/mx25lxx05d.py index 80b1a65..7c8a6fd 100644 --- a/decoders/mx25lxx05d/mx25lxx05d.py +++ b/decoders/mx25lxx05d/mx25lxx05d.py @@ -109,7 +109,7 @@ class Decoder(srd.Decoder): ] options = {} # TODO annotations = [ - ['TODO', 'TODO'], + ['Text', 'Human-readable text'], ] def __init__(self, **kwargs): @@ -124,7 +124,7 @@ class Decoder(srd.Decoder): pass def putx(self, data): - # Simplification, most annotations span extactly one SPI byte/packet. + # Simplification, most annotations span exactly one SPI byte/packet. self.put(self.ss, self.es, self.out_ann, data) def handle_wren(self, mosi, miso): diff --git a/decoders/mxc6225xu/mxc6225xu.py b/decoders/mxc6225xu/mxc6225xu.py index 7ad6396..5769f3e 100644 --- a/decoders/mxc6225xu/mxc6225xu.py +++ b/decoders/mxc6225xu/mxc6225xu.py @@ -76,7 +76,7 @@ class Decoder(srd.Decoder): ] options = {} annotations = [ - ['TODO', 'TODO'], + ['Text', 'Human-readable text'], ] def __init__(self, **kwargs): diff --git a/decoders/nunchuk/nunchuk.py b/decoders/nunchuk/nunchuk.py index c756f4d..0c4cf11 100644 --- a/decoders/nunchuk/nunchuk.py +++ b/decoders/nunchuk/nunchuk.py @@ -35,7 +35,7 @@ class Decoder(srd.Decoder): optional_probes = [] # TODO options = {} annotations = [ - ['TODO', 'TODO'], + ['Text', 'Human-readable text'], ] def __init__(self, **kwargs): diff --git a/decoders/pan1321/pan1321.py b/decoders/pan1321/pan1321.py index eed24cd..9d1d812 100644 --- a/decoders/pan1321/pan1321.py +++ b/decoders/pan1321/pan1321.py @@ -22,9 +22,6 @@ import sigrokdecode as srd -# Annotation feed formats -ANN_ASCII = 0 - # ... RX = 0 TX = 1 @@ -42,7 +39,7 @@ class Decoder(srd.Decoder): optional_probes = [] options = {} annotations = [ - ['ASCII', 'TODO: description'], + ['Text', 'Human-readable text'], ] def __init__(self, **kwargs): diff --git a/decoders/rtc8564/rtc8564.py b/decoders/rtc8564/rtc8564.py index 6677f7b..c74630a 100644 --- a/decoders/rtc8564/rtc8564.py +++ b/decoders/rtc8564/rtc8564.py @@ -43,7 +43,7 @@ class Decoder(srd.Decoder): ] options = {} annotations = [ - ['TODO', 'TODO'], + ['Text', 'Human-readable text'], ] def __init__(self, **kwargs): diff --git a/decoders/usb/usb.py b/decoders/usb/usb.py index 07f7bc0..5bfaf69 100644 --- a/decoders/usb/usb.py +++ b/decoders/usb/usb.py @@ -97,7 +97,7 @@ class Decoder(srd.Decoder): optional_probes = [] options = {} annotations = [ - ['TODO', 'TODO'] + ['Text', 'Human-readable text'] ] def __init__(self):