Fixes issue #13. Delay reading the button.#14
Merged
devanlai merged 4 commits intodevanlai:masterfrom Aug 9, 2019
0x3333:master
Merged
Fixes issue #13. Delay reading the button.#14devanlai merged 4 commits intodevanlai:masterfrom 0x3333:master
devanlai merged 4 commits intodevanlai:masterfrom
0x3333:master
Conversation
devanlai
requested changes
Aug 9, 2019
Owner
devanlai
left a comment
There was a problem hiding this comment.
Adding a delay seems like an appropriate fix for the case where you don't have a reset button and can only reset to the bootloader by holding down the button and powering up the board.
The only change I would like to see would be replacing the hard coded cycle count with a board-specific config define, since the necessary number of cycles will depend on both the clock speed and the external RC time constant. Maybe call it something like BUTTON_SAMPLE_DELAY_CYCLES.
Contributor
Author
|
That is exactly my situation. Nice addition, will update the PR. |
Contributor
Author
|
Done. |
devanlai
reviewed
Aug 9, 2019
devanlai
approved these changes
Aug 9, 2019
Owner
|
Thanks for finding this overlooked case and fixing it! |
devanlai
added a commit
that referenced
this pull request
Aug 9, 2019
Issue #14 Fix a miserable typo.
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.
This PR adds a delay before reading the button state, in case the board has a debounce capacitor.
In a 72Mhz it will take approximately 20ms.