summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
Diffstat (limited to 'decoders')
-rw-r--r--decoders/uart/pd.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py
index b10012a..cca8952 100644
--- a/decoders/uart/pd.py
+++ b/decoders/uart/pd.py
@@ -111,8 +111,8 @@ class Decoder(srd.Decoder):
self.stopbit1 = [-1, -1]
self.startsample = [-1, -1]
self.state = ['WAIT FOR START BIT', 'WAIT FOR START BIT']
- self.oldbit = [None, None]
- self.oldpins = None
+ self.oldbit = [1, 1]
+ self.oldpins = [1, 1]
def start(self, metadata):
self.samplerate = metadata['samplerate']
@@ -268,14 +268,6 @@ class Decoder(srd.Decoder):
# continue
self.oldpins, (rx, tx) = pins, pins
- # First sample: Save RX/TX value.
- if self.oldbit[RX] == None:
- self.oldbit[RX] = rx
- continue
- if self.oldbit[TX] == None:
- self.oldbit[TX] = tx
- continue
-
# State machine.
for rxtx in (RX, TX):
signal = rx if (rxtx == RX) else tx