drivers/periph/timer: document timer_init re-initialization precondition - #22385
drivers/periph/timer: document timer_init re-initialization precondition#22385andrewlihhh wants to merge 3 commits into
Conversation
|
Hey @andrewlihhh, thank you for your first contribution! We really appreciate it! If you haven't already, please take a look at our contributing guidelines before the review process starts. Also, due to how the GitHub review system works, please avoid force-pushing or squashing your commits unless asked to by a maintainer (or unless your commit is still in "draft commit" stage). Lastly, make sure to comply with our AI Policy when using AI. Your pull request will be reviewed as soon as possible. |
|
Thank you for the Pull Request. Can you provide some testing traces of the board before and after your PR to show the changes? Also, you don't have to open a separate issue if you intend to open a PR too, that's redundant. |
|
I do not have the original This is not meant as exact board-level validation for What changes is the delivery point of the same pending IRQ relative to the re-init window. Before, the pending IRQ can be handled during the re-init window: After, the same pending IRQ is deferred until the end of the interrupt-masked region: So while this is not a direct |
|
I reworked this PR into a documentation-only change as suggested. It now documents the |
Co-authored-by: crasbe <crasbe@gmail.com>
crasbe
left a comment
There was a problem hiding this comment.
Thank you for addressing the changes! Please squash!
Contribution description
This PR documents the usage model of
timer_init()for the same timer device.The discussion in #22384 pointed out that the
periph_timerAPI did not clearlystate whether calling
timer_init()again on an already active timer issupported.
This PR clarifies that callers must not call
timer_init()again on the sametimer while it is active. A timer must either not have been initialized before,
or it must be stopped with
timer_stop()before callingtimer_init()again.The change is documentation-only. It does not change any timer implementation.
Testing procedure
Documentation-only change.
To review:
@preentry indrivers/include/periph/timer.h.periph_timerentry indrivers/include/periph/doc.txt.Issues/PRs references
Refs #22384
Declaration of AI-Tools / LLMs usage:
AI-Tools / LLMs that were used are: