]> sigrok.org Git - libsigrokdecode.git/commitdiff
usb_signalling: Define annotation rows.
authorUwe Hermann <redacted>
Sat, 1 Feb 2014 14:41:36 +0000 (15:41 +0100)
committerUwe Hermann <redacted>
Sat, 1 Feb 2014 14:59:13 +0000 (15:59 +0100)
decoders/usb_signalling/pd.py

index 35ffce6b70128580f7c61117899be9416d379866..543089e041ef76dbbd51b153eed128a792a200c6 100644 (file)
@@ -90,6 +90,10 @@ class Decoder(srd.Decoder):
         ['bit', 'Bit'],
         ['stuffbit', 'Stuff bit'],
     ]
+    annotation_rows = (
+        ('bits', 'Bits', (1, 2, 3, 4)),
+        ('symbols', 'Symbols', (0,)),
+    )
 
     def __init__(self):
         self.samplerate = None
@@ -159,12 +163,14 @@ class Decoder(srd.Decoder):
         if self.consecutive_ones == 6 and b == '0':
             # Stuff bit.
             self.putpb(['STUFF BIT', None])
-            self.putb([4, ['SB: %s/%s' % (sym, b)]])
+            self.putb([4, ['SB: %s' % b]])
+            self.putb([0, ['%s' % sym]])
             self.consecutive_ones = 0
         else:
             # Normal bit (not a stuff bit).
             self.putpb(['BIT', b])
-            self.putb([3, ['%s/%s' % (sym, b)]])
+            self.putb([3, ['%s' % b]])
+            self.putb([0, ['%s' % sym]])
             if b == '1':
                 self.consecutive_ones += 1
             else: