forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
STM32: Add never_reset reservation to RGBMatrix init #3441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with "never_reset", does
stm_peripherals_timer_free
incommon_hal_rgbmatrix_timer_free()
remain enough to fully deallocate/free/reset the timer?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, can you rephrase?
stm_peripherals_timer_free
does undo never reset, is that your question? What do you mean by "remain"?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not fully familiar/comfortable with the transitions among these states; the naming is a bit different in each port and for each type of managed resource and I'm never entirely confident the semantics are the same. (As a larger issue, it wouldn't hurt to document this for developers reference and to ensure consistency)
My question is whether the state transtion from "timer is in never_reset state" to "timer is in free state" by calling "timer_free" is a correct transition. I think you answered yes.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think the going concept here is that
never_reset
is actually a wholly separate option fromreserved
- it is possible to have an un-reserved
pin that is not innever_reset
. I suggested joining the two at one point, so thatnever_reset
was strictly a subset ofreserved
, but I believe we decided against it (I don't fully remember the reason).Conceptually,
reserved
is the idea that a pin/peripheral cannot be claimed twice within a single runtime.never_reset
is the idea that resetting will not change thereserved
status or the pin attributes of that pin/peripheral (basically, immunity status to thereset_all
function). To turn offnever_reset
, you typically call the single-reset function (the not reset-all one) which completely resets all aspects of the pin/peripheral. We have somereset_ok
functions which specifically turn offnever_reset
and nothing else, but they're rarely implemented and even more rarely used.I'd definitely be down to document this or remove any inconsistencies that you have found. I think we could also revisit whether the two ideas should be combined more concretely in some way - basically, is there ever a scenario where you want something to be in never_reset without it actually being claimed?