]> sigrok.org Git - libsigrokdecode.git/commitdiff
tlc5620: Output short/long annotations.
authorUwe Hermann <redacted>
Wed, 9 Oct 2013 17:10:29 +0000 (19:10 +0200)
committerUwe Hermann <redacted>
Sun, 13 Oct 2013 11:48:56 +0000 (13:48 +0200)
This fixes (the remaining parts of) bug #168.

decoders/tlc5620/pd.py

index 9ce9e94e9a1b6a10bd010b7d8cc2d739828bdcf8..61f6028f5a58c774fe525fd4a117acf34130be37 100644 (file)
@@ -73,27 +73,30 @@ class Decoder(srd.Decoder):
 
     def handle_11bits(self):
         s = "".join(str(i) for i in self.bits[:2])
 
     def handle_11bits(self):
         s = "".join(str(i) for i in self.bits[:2])
-        self.dac_select = dacs[int(s, 2)]
+        self.dac_select = s = dacs[int(s, 2)]
         self.put(self.ss_dac, self.es_dac, self.out_ann,
         self.put(self.ss_dac, self.es_dac, self.out_ann,
-                 [0, ['DAC select: %s' % self.dac_select]])
+                 [0, ['DAC select: %s' % s, 'DAC sel: %s' % s,
+                      'DAC: %s' % s, 'D: %s' % s, s, s[3]]])
 
 
-        self.gain = 1 + self.bits[2]
+        self.gain = g = 1 + self.bits[2]
         self.put(self.ss_gain, self.es_gain, self.out_ann,
         self.put(self.ss_gain, self.es_gain, self.out_ann,
-                 [1, ['Gain: x%d' % self.gain]])
+                 [1, ['Gain: x%d' % g, 'G: x%d' % g, 'x%d' % g]])
 
         s = "".join(str(i) for i in self.bits[3:])
 
         s = "".join(str(i) for i in self.bits[3:])
-        self.dac_value = int(s, 2)
+        self.dac_value = v = int(s, 2)
         self.put(self.ss_value, self.es_value, self.out_ann,
         self.put(self.ss_value, self.es_value, self.out_ann,
-                 [2, ['DAC value: %d' % self.dac_value]])
+                 [2, ['DAC value: %d' % v, 'Value: %d' % v, 'Val: %d' % v,
+                      'V: %d' % v, '%d' % v]])
 
     def handle_falling_edge_load(self):
 
     def handle_falling_edge_load(self):
+        s, v, g = self.dac_select, self.dac_value, self.gain
         self.put(self.samplenum, self.samplenum, self.out_ann,
         self.put(self.samplenum, self.samplenum, self.out_ann,
-                 [3, ['Setting %s value to %d (x%d gain)' % \
-                 (self.dac_select, self.dac_value, self.gain)]])
+                 [3, ['Setting %s value to %d (x%d gain)' % (s, v, g),
+                      '%s=%d (x%d gain)' % (s, v, g)]])
 
     def handle_falling_edge_ldac(self):
         self.put(self.samplenum, self.samplenum, self.out_ann,
 
     def handle_falling_edge_ldac(self):
         self.put(self.samplenum, self.samplenum, self.out_ann,
-                 [4, ['Falling edge on LDAC pin']])
+                 [4, ['Falling edge on LDAC pin', 'LDAC fall', 'LDAC']])
 
     def handle_new_dac_bit(self):
         self.bits.append(self.datapin)
 
     def handle_new_dac_bit(self):
         self.bits.append(self.datapin)