Audit timers HAL #2: Remove channel array#531
Closed
kurtjd wants to merge 1 commit intoOpenDevicePartnership:mainfrom
Closed
Audit timers HAL #2: Remove channel array#531kurtjd wants to merge 1 commit intoOpenDevicePartnership:mainfrom
kurtjd wants to merge 1 commit intoOpenDevicePartnership:mainfrom
Conversation
RobertZ2011
pushed a commit
that referenced
this pull request
Dec 17, 2025
Depends on #531 Resolves #530 This removes the last of the panic paths in the timers HAL by removing unwraps and changing a few constructors to return a `Result` instead (which introduces a breaking change). A new freq field was added to the PWM struct since originally, we unwrapped in a PWM trait method which does not return a `Result`. So, we just verify the clock config is valid in the constructor and can use the cached freq in the trait methods.
Contributor
Author
|
Closing since #532 captures these changes. |
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.
We can remove the need for indexing into a channel array by just implementing
From. We keep theTimerChannelNumenum because this can be determined statically, whereas if we keptchannelas just ausizewe couldn't get an exhaustive match (and would therefore theoretically be fallible). Tested on hardware. Related: #530Going to be one more PR after this to remove the
unwraps (keeping that separate since it will likely introduce breaking changes).