diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2012-03-04 10:40:58 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2012-03-04 15:10:11 +0100 |
commit | 1541976fcac03a780b5d27046f5f8884973c08ae (patch) | |
tree | 054478b06b1623b05258c8fd2241eda93dbb7418 /decoders/i2c | |
parent | 2b7160383cc189f721600c04be17a980e216dfd6 (diff) | |
download | libsigrokdecode-1541976fcac03a780b5d27046f5f8884973c08ae.tar.gz libsigrokdecode-1541976fcac03a780b5d27046f5f8884973c08ae.zip |
srd: PDs: More cosmetics.
Diffstat (limited to 'decoders/i2c')
-rw-r--r-- | decoders/i2c/i2c.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/decoders/i2c/i2c.py b/decoders/i2c/i2c.py index 2c11be0..cc70e96 100644 --- a/decoders/i2c/i2c.py +++ b/decoders/i2c/i2c.py @@ -38,7 +38,7 @@ ANN_SHIFTED_SHORT = 1 ANN_RAW = 2 # Values are verbose and short annotation, respectively. -protocol = { +proto = { 'START': ['START', 'S'], 'START REPEAT': ['START REPEAT', 'Sr'], 'STOP': ['STOP', 'P'], @@ -119,8 +119,8 @@ class Decoder(srd.Decoder): cmd = 'START REPEAT' if (self.is_repeat_start == 1) else 'START' self.put(self.out_proto, [cmd, None]) - self.put(self.out_ann, [ANN_SHIFTED, [protocol[cmd][0]]]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol[cmd][1]]]) + self.put(self.out_ann, [ANN_SHIFTED, [proto[cmd][0]]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, [proto[cmd][1]]]) self.state = 'FIND ADDRESS' self.bitcount = self.databyte = 0 @@ -165,8 +165,8 @@ class Decoder(srd.Decoder): cmd = 'DATA READ' self.put(self.out_proto, [cmd, d]) - self.put(self.out_ann, [ANN_SHIFTED, [protocol[cmd][0], '0x%02x' % d]]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol[cmd][1], '0x%02x' % d]]) + self.put(self.out_ann, [ANN_SHIFTED, [proto[cmd][0], '0x%02x' % d]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, [proto[cmd][1], '0x%02x' % d]]) # Done with this packet. self.startsample = -1 @@ -177,8 +177,8 @@ class Decoder(srd.Decoder): self.startsample = self.samplenum ack_bit = 'NACK' if (sda == 1) else 'ACK' self.put(self.out_proto, [ack_bit, None]) - self.put(self.out_ann, [ANN_SHIFTED, [protocol[ack_bit][0]]]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol[ack_bit][1]]]) + self.put(self.out_ann, [ANN_SHIFTED, [proto[ack_bit][0]]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, [proto[ack_bit][1]]]) # There could be multiple data bytes in a row, so either find # another data byte or a STOP condition next. self.state = 'FIND DATA' @@ -186,8 +186,8 @@ class Decoder(srd.Decoder): def found_stop(self, scl, sda): self.startsample = self.samplenum self.put(self.out_proto, ['STOP', None]) - self.put(self.out_ann, [ANN_SHIFTED, [protocol['STOP'][0]]]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol['STOP'][1]]]) + self.put(self.out_ann, [ANN_SHIFTED, [proto['STOP'][0]]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, [proto['STOP'][1]]]) self.state = 'FIND START' self.is_repeat_start = 0 |