From: Soeren Apel Date: Sat, 11 Aug 2018 19:12:16 +0000 (+0200) Subject: counter: Use initial counter values also after a reset X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5dd2a4c0c2872be7dda3be9ea0ce087826754a82;p=libsigrokdecode.git counter: Use initial counter values also after a reset --- 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