]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: Remove TODOs from annotation format names.
authorUwe Hermann <redacted>
Tue, 8 May 2012 21:53:48 +0000 (23:53 +0200)
committerUwe Hermann <redacted>
Tue, 8 May 2012 21:53:48 +0000 (23:53 +0200)
Also, fix minor consistency issues, cosmetics, typos.

decoders/dcf77/dcf77.py
decoders/i2cfilter/i2cfilter.py
decoders/i2s/i2s.py
decoders/jtag/jtag.py
decoders/lpc/lpc.py
decoders/mx25lxx05d/mx25lxx05d.py
decoders/mxc6225xu/mxc6225xu.py
decoders/nunchuk/nunchuk.py
decoders/pan1321/pan1321.py
decoders/rtc8564/rtc8564.py
decoders/usb/usb.py

index 573888f15e88e91c20d7521d98d55df5fac3adaa..a02eb324c5bc9d7a58fa94bced537791ea984430 100644 (file)
@@ -24,7 +24,7 @@ import sigrokdecode as srd
 import calendar
 
 # Annotation feed formats
 import calendar
 
 # Annotation feed formats
-ANN_ASCII = 0
+ANN_TEXT = 0
 
 # Return the specified BCD number (max. 8 bits) as integer.
 def bcd2int(b):
 
 # Return the specified BCD number (max. 8 bits) as integer.
 def bcd2int(b):
@@ -47,8 +47,8 @@ class Decoder(srd.Decoder):
     ]
     options = {}
     annotations = [
     ]
     options = {}
     annotations = [
-        # ANN_ASCII
-        ['ASCII', 'TODO: description'],
+        # ANN_TEXT
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
index 6b3d1134326f067c6af2d4367519195988cfb5de..fad11c31d77a718023dda904c3a00ffa59bb3b86 100644 (file)
@@ -30,10 +30,13 @@ class Decoder(srd.Decoder):
     license = 'gplv3+'
     inputs = ['i2c']
     outputs = []
     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)', '']
     }
     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
 
     def __init__(self, **kwargs):
         self.state = None
index d627ebb6867e85b3e5820383e02b206b0b2614de..b81f2dd45d59f61319418f183d38e43626d34a8b 100644 (file)
@@ -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'},
     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 = [
     annotations = [
-        ['ASCII', 'Annotations in ASCII format'],
+        ['Hex', 'Annotations in hex format'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
@@ -62,12 +64,12 @@ class Decoder(srd.Decoder):
 
     def report(self):
 
 
     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 = '?'
         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))
 
                 self.samplerate / (self.start_sample -
                 self.first_sample))
 
@@ -82,26 +84,26 @@ class Decoder(srd.Decoder):
                 continue
 
             self.oldsck = sck
                 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
 
                 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
 
             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,
             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,
                 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 '
                 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
 
             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
             if self.first_sample == None:
                 self.first_sample = self.samplenum
 
             self.oldws = ws
-            
\ No newline at end of file
+
index df16d2b28a2837ae15b496227a555c26d2210146..d2568abb64cddc6196e3ca18a684431a56045fc2 100644 (file)
@@ -43,7 +43,7 @@ class Decoder(srd.Decoder):
     ]
     options = {}
     annotations = [
     ]
     options = {}
     annotations = [
-        ['ASCII', 'TODO: description'],
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
index 9bc91cd870de13a33d88f021be61432e5118c87a..1357fbd1b17e0542d0363dcdddaf2cf5a2cae308 100644 (file)
@@ -22,9 +22,6 @@
 
 import sigrokdecode as srd
 
 
 import sigrokdecode as srd
 
-# Annotation feed formats
-ANN_ASCII = 0
-
 # ...
 fields = {
     # START field (indicates start or stop of a transaction)
 # ...
 fields = {
     # START field (indicates start or stop of a transaction)
@@ -128,7 +125,7 @@ class Decoder(srd.Decoder):
     ]
     options = {}
     annotations = [
     ]
     options = {}
     annotations = [
-        ['ASCII', 'TODO: description'],
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
index 80b1a658872351062bc7effcf0ff73f489f2a596..7c8a6fd3beb172bfccde00d9a09949aacb6888c4 100644 (file)
@@ -109,7 +109,7 @@ class Decoder(srd.Decoder):
     ]
     options = {} # TODO
     annotations = [
     ]
     options = {} # TODO
     annotations = [
-        ['TODO', 'TODO'],
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
@@ -124,7 +124,7 @@ class Decoder(srd.Decoder):
         pass
 
     def putx(self, data):
         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):
         self.put(self.ss, self.es, self.out_ann, data)
 
     def handle_wren(self, mosi, miso):
index 7ad639691012493b5363270433da4d3f3d5d25fe..5769f3e691df066bf9c13868e2f45912439f96e5 100644 (file)
@@ -76,7 +76,7 @@ class Decoder(srd.Decoder):
     ]
     options = {}
     annotations = [
     ]
     options = {}
     annotations = [
-        ['TODO', 'TODO'],
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
index c756f4d43d5513b66663c4b79dbe50e6d38d9daa..0c4cf11277f7825320f33cda1fe87210a753100c 100644 (file)
@@ -35,7 +35,7 @@ class Decoder(srd.Decoder):
     optional_probes = [] # TODO
     options = {}
     annotations = [
     optional_probes = [] # TODO
     options = {}
     annotations = [
-        ['TODO', 'TODO'],
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
index eed24cdf6272674db9df2749323ad69fe3a2c9a2..9d1d8122e763a06b5285b6918ba5854ee69764ca 100644 (file)
@@ -22,9 +22,6 @@
 
 import sigrokdecode as srd
 
 
 import sigrokdecode as srd
 
-# Annotation feed formats
-ANN_ASCII = 0
-
 # ...
 RX = 0
 TX = 1
 # ...
 RX = 0
 TX = 1
@@ -42,7 +39,7 @@ class Decoder(srd.Decoder):
     optional_probes = []
     options = {}
     annotations = [
     optional_probes = []
     options = {}
     annotations = [
-        ['ASCII', 'TODO: description'],
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
index 6677f7b02c68cde3cb80d051faaae322094e6c78..c74630a53713182595bef0c08c4d60e24b5f9fd2 100644 (file)
@@ -43,7 +43,7 @@ class Decoder(srd.Decoder):
     ]
     options = {}
     annotations = [
     ]
     options = {}
     annotations = [
-        ['TODO', 'TODO'],
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
index 07f7bc0736566e142c58b78579916372340d8fc3..5bfaf6901fd2555438fc91fa668735e3f2bb105b 100644 (file)
@@ -97,7 +97,7 @@ class Decoder(srd.Decoder):
     optional_probes = []
     options = {}
     annotations = [
     optional_probes = []
     options = {}
     annotations = [
-        ['TODO', 'TODO']
+        ['Text', 'Human-readable text']
     ]
 
     def __init__(self):
     ]
 
     def __init__(self):