summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorGerhard Sittig <gerhard.sittig@gmx.net>2017-01-15 11:26:19 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2017-01-18 12:38:24 +0100
commit2bde58c5654e7f0103a301548ac60ba294d5b649 (patch)
treeae70f8afb52f8047b5064cbaa440f1f54432a78e /decoders
parentc551f324c89c1bc83b1f529c2b065cdb5a745c3a (diff)
downloadlibsigrokdecode-2bde58c5654e7f0103a301548ac60ba294d5b649.tar.gz
libsigrokdecode-2bde58c5654e7f0103a301548ac60ba294d5b649.zip
z80: Convert to PD API version 3 (brute force)
This implementation technically uses v3 API calls, but has yet to come up with appropriate wait() conditions, to spend less time in the decoder and have more tedious work done in the backend.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/z80/pd.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/decoders/z80/pd.py b/decoders/z80/pd.py
index a8acf53..bd2ec57 100644
--- a/decoders/z80/pd.py
+++ b/decoders/z80/pd.py
@@ -64,7 +64,7 @@ def signed_byte(byte):
return byte if byte < 128 else byte - 256
class Decoder(srd.Decoder):
- api_version = 2
+ api_version = 3
id = 'z80'
name = 'Z80'
longname = 'Zilog Z80 CPU'
@@ -129,8 +129,10 @@ class Decoder(srd.Decoder):
self.op_state = self.state_IDLE
self.instr_len = 0
- def decode(self, ss, es, data):
- for (self.samplenum, pins) in data:
+ def decode(self):
+ while True:
+ # TODO: Come up with more appropriate self.wait() conditions.
+ pins = self.wait({'skip': 1})
cycle = Cycle.NONE
if pins[Pin.MREQ] != 1: # default to asserted
if pins[Pin.RD] == 0: