Repository navigation
Add button_e_pressed property and make any_button_pressed dynamic - #99
Open
nikitashiwach2000 wants to merge 2 commits into
Open
nikitashiwach2000 wants to merge 2 commits into
nikitashiwach2000 wants to merge 2 commits into
Conversation
Fix trailing whitespace formatting error
FoamyGuy
reviewed
Jul 9, 2026
| return not self.buttons[3].value | ||
|
|
||
| @property | ||
| def button_e_pressed(self) -> bool: |
Contributor
There was a problem hiding this comment.
I would be in favor of naming this more descriptively to match the skilkscreen. There is no label "e" on the boot button. Granted there also don't appear to be labels a-d on the other buttons, but the four of them being in a row makes them a little easier to to match up with the letters a-d.
Can you rename the property to button_boot_pressed? That way it is immediately clear when reading it which physical button it's referring to.
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.
Fixes #98
Description of Changes
button_e_pressedproperty for theBOOT0button.any_button_pressedto dynamically iterate through theself.buttonslist using a list comprehension instead of using a hardcoded range. This prevents future bugs if more buttons are added to the hardware.Testing Done
unittest.mock.MagicMockto simulate the hardware peripheral states. All logic passed successfully.