diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2011-11-27 21:51:39 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2011-11-27 22:19:56 +0100 |
commit | 5dd9af5bdc48c0b90512b2782bad893f76ee4a0b (patch) | |
tree | b1d2122d73b91a3521cd9ca5128fbfe6670e4937 /decoders | |
parent | 7b86f0bc7a0009e928e4bcc250c3e0cc12dda7ac (diff) | |
download | libsigrokdecode-5dd9af5bdc48c0b90512b2782bad893f76ee4a0b.tar.gz libsigrokdecode-5dd9af5bdc48c0b90512b2782bad893f76ee4a0b.zip |
srd: i2c.py: Mark Repeated Start condition as 'Sr'.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/i2c.py | 5 |
1 files changed, 4 insertions, 1 deletions
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 |