summaryrefslogtreecommitdiff
path: root/decoders/counter/pd.py
diff options
context:
space:
mode:
authorSoeren Apel <soeren@apelpie.net>2018-08-11 21:12:16 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2018-08-30 11:56:32 +0200
commit5dd2a4c0c2872be7dda3be9ea0ce087826754a82 (patch)
treee640db3424cb5ce6accb174b688d15803c08f6f0 /decoders/counter/pd.py
parentf04db50ab7bbc59b7668396500b92ae2d3418f0e (diff)
downloadlibsigrokdecode-5dd2a4c0c2872be7dda3be9ea0ce087826754a82.tar.gz
libsigrokdecode-5dd2a4c0c2872be7dda3be9ea0ce087826754a82.zip
counter: Use initial counter values also after a reset
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 b8811e5..b01b5e6 100644
--- a/decoders/counter/pd.py
+++ b/decoders/counter/pd.py
@@ -53,8 +53,8 @@ class Decoder(srd.Decoder):
{'id': 'divider', 'desc': 'Count divider (word width)', 'default': 0},
{'id': 'reset_edge', 'desc': 'Edge which clears counters (reset)',
'default': 'falling', 'values': ('rising', 'falling')},
- {'id': 'edge_off', 'desc': 'Initial edge counter value', 'default': 0},
- {'id': 'word_off', 'desc': 'Initial word counter value', 'default': 0},
+ {'id': 'edge_off', 'desc': 'Edge counter value after start/reset', 'default': 0},
+ {'id': 'word_off', 'desc': 'Word counter value after start/reset', 'default': 0},
)
def __init__(self):
@@ -97,9 +97,9 @@ class Decoder(srd.Decoder):
now = self.samplenum
if have_reset and self.matched[cond_reset]:
- edge_count = 0
+ edge_count = int(self.options['edge_off'])
edge_start = now
- word_count = 0
+ word_count = int(self.options['word_off'])
word_start = now
self.putc(ROW_RESET, now, ['Word reset', 'Reset', 'Rst', 'R'])
continue