summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-01-12 22:49:41 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2012-01-12 22:49:41 +0100
commit2b9837d9fc5f9b4eca52327527e18db4bfb730ff (patch)
tree7be1a6c40202b1cd1c88afc8d588b354765f7559 /decoders
parent9a12a6e7af3d7091d8e35dd1c731402cb80a01b0 (diff)
downloadlibsigrokdecode-2b9837d9fc5f9b4eca52327527e18db4bfb730ff.tar.gz
libsigrokdecode-2b9837d9fc5f9b4eca52327527e18db4bfb730ff.zip
srd: decoders: Rename obsolete timeoffset/duration.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/ddc.py7
-rw-r--r--decoders/i2c.py2
-rw-r--r--decoders/mx25lxx05d.py2
-rw-r--r--decoders/nunchuk.py2
-rw-r--r--decoders/spi.py8
-rw-r--r--decoders/srd_usb.py2
-rw-r--r--decoders/transitioncounter.py2
-rw-r--r--decoders/uart.py2
8 files changed, 13 insertions, 14 deletions
diff --git a/decoders/ddc.py b/decoders/ddc.py
index cdeae6d..9b5bc5f 100644
--- a/decoders/ddc.py
+++ b/decoders/ddc.py
@@ -52,9 +52,9 @@ class Decoder(srd.Decoder):
def start(self, metadata):
self.out_ann = self.add(srd.OUTPUT_ANN, 'ddc')
- def decode(self, start_sample, end_sample, i2c_data):
+ def decode(self, ss, es, data):
try:
- cmd, data, ack_bit = i2c_data
+ cmd, data, ack_bit = data
except Exception as e:
raise Exception('malformed I2C input: %s' % str(e)) from e
@@ -74,6 +74,5 @@ class Decoder(srd.Decoder):
if cmd == 'DATA_READ':
# There shouldn't be anything but data reads on this
# address, so ignore everything else.
- self.put(start_sample, end_sample, self.out_ann,
- [0, ['0x%.2x' % data]])
+ self.put(ss, es, self.out_ann, [0, ['0x%.2x' % data]])
diff --git a/decoders/i2c.py b/decoders/i2c.py
index 967899e..cfaacb0 100644
--- a/decoders/i2c.py
+++ b/decoders/i2c.py
@@ -269,7 +269,7 @@ class Decoder(srd.Decoder):
# TODO: 0-0 sample range for now.
super(Decoder, self).put(0, 0, output_id, data)
- def decode(self, timeoffset, duration, data):
+ def decode(self, ss, es, data):
for samplenum, (scl, sda) in data:
self.samplecnt += 1
diff --git a/decoders/mx25lxx05d.py b/decoders/mx25lxx05d.py
index 82a43cf..8055c63 100644
--- a/decoders/mx25lxx05d.py
+++ b/decoders/mx25lxx05d.py
@@ -310,7 +310,7 @@ class Decoder(srd.Decoder):
self.out += o
- def decode(self, timeoffset, duration, data):
+ def decode(self, ss, es, data):
self.out = []
# Iterate over all SPI MISO/MOSI packets. TODO: HOLD#, WP#/ACC?
diff --git a/decoders/nunchuk.py b/decoders/nunchuk.py
index 8bf0228..bda3745 100644
--- a/decoders/nunchuk.py
+++ b/decoders/nunchuk.py
@@ -91,7 +91,7 @@ class Decoder(srd.Decoder):
def report(self):
pass
- def decode(self, timeoffset, duration, data):
+ def decode(self, ss, es, data):
out = []
o = {}
diff --git a/decoders/spi.py b/decoders/spi.py
index e6a59bf..662b059 100644
--- a/decoders/spi.py
+++ b/decoders/spi.py
@@ -51,7 +51,7 @@ class Decoder(srd.Decoder):
def report(self):
return 'SPI: %d bytes received' % self.bytesreceived
- def decode(self, timeoffset, duration, data):
+ def decode(self, ss, es, data):
# HACK! At the moment the number of probes is not handled correctly.
# E.g. if an input file (-i foo.sr) has more than two probes enabled.
for (samplenum, (sdata, sck, x, y, z, a)) in data:
@@ -65,7 +65,7 @@ class Decoder(srd.Decoder):
# If this is first bit, save timestamp
if self.rxcount == 0:
- self.time = timeoffset # FIXME
+ self.time = ss # FIXME
# Receive bit into our shift register
if sdata:
self.rxdata |= 1 << (7 - self.rxcount)
@@ -74,8 +74,8 @@ class Decoder(srd.Decoder):
if self.rxcount != 8:
continue
# Received a byte, pass up to sigrok
- outdata = {'time':self.time,
- 'duration':timeoffset + duration - self.time,
+ outdata = {'time':self.time, # FIXME
+ 'duration':ss + es - self.time, # FIXME
'data':self.rxdata,
'display':('%02X' % self.rxdata),
'type':'spi',
diff --git a/decoders/srd_usb.py b/decoders/srd_usb.py
index 9998e5b..2573639 100644
--- a/decoders/srd_usb.py
+++ b/decoders/srd_usb.py
@@ -133,7 +133,7 @@ class Decoder(srd.Decoder):
self.scount = 0
self.packet = ''
- def decode(self, timeoffset, duration, data):
+ def decode(self, ss, es, data):
out = []
# FIXME
diff --git a/decoders/transitioncounter.py b/decoders/transitioncounter.py
index 40fa3a8..2247248 100644
--- a/decoders/transitioncounter.py
+++ b/decoders/transitioncounter.py
@@ -46,7 +46,7 @@ class Decoder(srd.Decoder):
def report(self):
pass
- def decode(self, timeoffset, duration, data):
+ def decode(self, ss, es, data):
for (samplenum, s) in data:
diff --git a/decoders/uart.py b/decoders/uart.py
index 9243bbc..f0f3bf8 100644
--- a/decoders/uart.py
+++ b/decoders/uart.py
@@ -416,7 +416,7 @@ class Decoder(srd.Decoder):
self.put(self.samplenum, self.samplenum, self.out_ann,
[ANN_ASCII, ['Stop bit', 'Stop', 'P']])
- def decode(self, timeoffset, duration, data): # TODO
+ def decode(self, ss, es, data): # TODO
# for (samplenum, (rx, tx)) in data:
for (samplenum, (rx,)) in data: