]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: i2c.py: Mark Repeated Start condition as 'Sr'.
authorUwe Hermann <redacted>
Sun, 27 Nov 2011 20:51:39 +0000 (21:51 +0100)
committerUwe Hermann <redacted>
Sun, 27 Nov 2011 21:19:56 +0000 (22:19 +0100)
decoders/i2c.py

index b99b26cfe22370037fd97f62c60768f193bfe26b..71bfb6cfaf5308d39798e9f6cc320e3ccdb6cbdd 100644 (file)
@@ -166,6 +166,7 @@ class Decoder():
         self.databyte = 0
         self.wr = -1
         self.startsample = -1
+        self.is_repeat_start = 0
 
         self.FIND_START, self.FIND_ADDRESS, self.FIND_DATA = range(3)
         self.state = self.FIND_START
@@ -205,10 +206,11 @@ class Decoder():
         out = []
         # o = {'type': 'S', 'range': (self.samplenum, self.samplenum),
         #      'data': None, 'ann': None},
-        o = 'S'
+        o = (self.is_repeat_start == 1) and 'Sr' or 'S'
         out.append(o)
         self.state = self.FIND_ADDRESS
         self.bitcount = self.databyte = 0
+        self.is_repeat_start = 1
         self.wr = -1
         return out
 
@@ -285,6 +287,7 @@ class Decoder():
         o = 'P'
         out.append(o)
         self.state = self.FIND_START
+        self.is_repeat_start = 0
         self.wr = -1
 
         return out