cpu/native: Add support for periph_timer_query_freqs#20306
Merged
maribu merged 1 commit intoRIOT-OS:masterfrom Jan 30, 2024
Merged
cpu/native: Add support for periph_timer_query_freqs#20306maribu merged 1 commit intoRIOT-OS:masterfrom
maribu merged 1 commit intoRIOT-OS:masterfrom
Conversation
maribu
reviewed
Jan 29, 2024
Member
maribu
left a comment
There was a problem hiding this comment.
Thanks for adding this. The CI has same nitpicks, feel free to amend directly rather than using --fixup= commits.
Btw: This is excellent first PR (unless I overlooked other PRs of you)!
cpu/native/periph/timer.c
Outdated
| assert(dev < TIMER_NUMOF); | ||
|
|
||
| if (index > 0) { | ||
| return 0; |
Member
There was a problem hiding this comment.
Suggested change
| return 0; | |
| return 0; |
cpu/native/include/periph_conf.h
Outdated
| */ | ||
| #define TIMER_NUMOF (1U) | ||
| #define TIMER_NUMOF (1U) | ||
| #define TIMER_CHANNEL_NUMOF (1U) |
Member
There was a problem hiding this comment.
Suggested change
| #define TIMER_CHANNEL_NUMOF (1U) | |
| #define TIMER_CHANNEL_NUMOF (1U) /**< number of timer channels */ |
I'm well aware that the name is pretty self-documenting, but the CI insists on having this documented. The alternative would be to add this to the list of exceptions, but that is IMHO more effort that just documenting the obvious.
Add support for querying the frequency supported by `periph_timer`. This allows applications which require this feature to run on the `native` board. Signed-off-by: Armin Wolf <[email protected]>
d1902ad to
6070c57
Compare
maribu
approved these changes
Jan 30, 2024
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.
Contribution description
This pull request adds support for the
periph_timer_query_freqsfeature to thenativeplatform.The feature allows software to query the supported frequency of the timer, which in this case is
a fixed frequency used internally for time conversions.
This allows software which depends on this feature to run on the
nativeboard. Since theperiph/timertest expects all timers supporting this feature to also define
TIMER_CHANNEL_NUMOF, the necessary definewas added to the CPU configuration.
Testing procedure
Build:
make BOARD=native -C tests/periph/timer flash test