Repository navigation
drivers/timers/capture: Make getedges optional - #20936
Merged
xiaoxiang781216 merged 2 commits intoOct 26, 2026
Merged
Conversation
Not all capture drivers currently implement getedges which causes the CAPIOC_EDGES to assert and CAPIOC_ALL to dereference a null pointer. For CAPIOC_EDGES this will now return -ENOTTY instead of asserting. For CAPIOC_ALL this will fill in the duty cycle and frequency and leave the edges value at 0. Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Darryl Ring <[email protected]>
Touching this file surfaced some code style issues. Signed-off-by: Darryl Ring <[email protected]>
Contributor
Author
|
Touching files exposes you to pre-existing formatting issues. |
|
xiaoxiang781216
approved these changes
Oct 24, 2026
Contributor
|
let's ignore ci error which is fixed by #20949 instead wasting ci resource by retrigger. |
GUIDINGLI
approved these changes
Oct 26, 2026
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.
Summary
Not all capture lower-half drivers currently implement
getedgeswhich causes theCAPIOC_EDGESto assert andCAPIOC_ALLto dereference a null pointer.For
CAPIOC_EDGESthis will now returnENOTTYinstead of asserting. ForCAPIOC_ALLthis will fill in the duty cycle and frequency and leave the edges value at 0.Next steps:
nuttx-apps/examples/captureto not error out ifCAPIOC_EDGESreturnsENOTTYgetedgesis truly optional and ensure each capture driver implements it if not.Impact
This will prevents crashes/assertions but otherwise have no impact.
Testing
Before
After
After (with capture.patch applied to
nuttx-apps):