From e28f7aee3b96afeb543e0c3c29e3950ddd61a490 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Tue, 8 Jul 2014 21:21:03 +0200 Subject: All PDs: Drop unneeded exceptions. In all current PDs it is not necessary to raise an exception upon invalid states (of the PD's state machine), since we can guarantee that no such invalid state can ever be reached in these PDs. --- decoders/parallel/pd.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'decoders/parallel') diff --git a/decoders/parallel/pd.py b/decoders/parallel/pd.py index 03b5e2f..0b512c8 100644 --- a/decoders/parallel/pd.py +++ b/decoders/parallel/pd.py @@ -92,7 +92,6 @@ class Decoder(srd.Decoder): self.oldpins = None self.ss_item = self.es_item = None self.first = True - self.state = 'IDLE' def start(self): self.out_python = self.register(srd.OUTPUT_PYTHON) @@ -181,12 +180,8 @@ class Decoder(srd.Decoder): continue self.oldpins = pins - # State machine. - if self.state == 'IDLE': - if pins[0] not in (0, 1): - self.handle_bits(pins[1:]) - else: - self.find_clk_edge(pins[0], pins[1:]) + if pins[0] not in (0, 1): + self.handle_bits(pins[1:]) else: - raise Exception('Invalid state: %s' % self.state) + self.find_clk_edge(pins[0], pins[1:]) -- cgit v1.2.3-70-g09d2