From: Uwe Hermann Date: Sun, 27 Nov 2011 20:51:39 +0000 (+0100) Subject: srd: i2c.py: Mark Repeated Start condition as 'Sr'. X-Git-Tag: libsigrokdecode-0.1.0~261 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5dd9af5bdc48c0b90512b2782bad893f76ee4a0b;p=libsigrokdecode.git srd: i2c.py: Mark Repeated Start condition as 'Sr'. --- diff --git a/decoders/i2c.py b/decoders/i2c.py index b99b26c..71bfb6c 100644 --- a/decoders/i2c.py +++ b/decoders/i2c.py @@ -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