summaryrefslogtreecommitdiff
path: root/decoders/counter/pd.py
diff options
context:
space:
mode:
Diffstat (limited to 'decoders/counter/pd.py')
-rw-r--r--decoders/counter/pd.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/decoders/counter/pd.py b/decoders/counter/pd.py
index cbb6a5f..6dd8d91 100644
--- a/decoders/counter/pd.py
+++ b/decoders/counter/pd.py
@@ -75,13 +75,13 @@ class Decoder(srd.Decoder):
self.put(self.samplenum, self.samplenum, self.out_ann, [cls, annlist])
def decode(self):
- condition = [{'rising': {0: 'r'},
- 'falling': {0: 'f'},
- 'any': {0: 'e'},}[self.edge]]
+ opt_edge_map = {'rising': 'r', 'falling': 'f', 'any': 'e'}
+
+ condition = [{0: opt_edge_map[self.edge]}]
if self.has_channel(1):
self.have_reset = True
- condition.append({1: self.options['reset_edge'][0]})
+ condition.append({1: opt_edge_map[self.options['reset_edge']]})
while True:
self.wait(condition)