summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
389d21d)
Introduce options for the initial edge and word counter values. Default
to 0 for compatibility with the previous implementation. This fixes
bug #1229.
{'id': 'divider', 'desc': 'Count divider (word width)', 'default': 0},
{'id': 'reset_edge', 'desc': 'Edge which clears counters (reset)',
'default': 'falling', 'values': ('rising', 'falling')},
{'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},
cond_reset = len(condition)
condition.append({PIN_RESET: opt_edge_map[reset_edge]})
cond_reset = len(condition)
condition.append({PIN_RESET: opt_edge_map[reset_edge]})
+ edge_count = int(self.options['edge_off'])
+ word_count = int(self.options['word_off'])
word_start = None
while True:
self.wait(condition)
word_start = None
while True:
self.wait(condition)