Repository navigation
countio: add selectable rise and fall detection, pulls - #5803
Merged
Merged
Conversation
jepler
approved these changes
Dec 31, 2021
jepler
left a comment
There was a problem hiding this comment.
Not tested, but did read through the changes. Looks good from here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses countio enhancements #5606.
Add selectable counting of rising or falling edges, or both (both is not possible on RP2040).
Add ability to specify a pull-up or pull-down.
The default was supposed to be falling, though on RP2040 it appears to have been rising. Fixed RP2040 to be consistent.
Renamed pin argument of
Counter()to bepininstead ofpin_a. Not sure why it waspin_a. That may be a leftover of something else.Remove
common_hal_countio_counter_reset(), since it can be done bycommon_hal_countio_counter_set_count(pin, 0).Introduce
countio.Edgeenumeration. The alternative was to provideriseandfallboolean arguments toCounter(), but seems more consistent with other such multi-value arguments.Unrelated: Fix some kind of accidental typo for the symbolic link for
tests/pyboard.py->../tools/cpboard.py. The symoblic link included a literal newline character, which is not obvious from the file comparison below.Tested on all the implemented platforms:
raspberrypi,espressif,atmel-samd,nrf: