-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Move CMSDK Counters/Timers to unified interface #10025
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
Move CMSDK Counters/Timers to unified interface #10025
Conversation
|
good to see you back @fvincenzo :) |
|
Codecov Report
@@ Coverage Diff @@
## topic-counters #10025 +/- ##
==================================================
+ Coverage 50.35% 53.53% +3.18%
==================================================
Files 320 239 -81
Lines 53658 27052 -26606
Branches 13377 6521 -6856
==================================================
- Hits 27017 14482 -12535
+ Misses 21574 9900 -11674
+ Partials 5067 2670 -2397
Continue to review full report at Codecov.
|
|
please fix conflicts |
|
please rebase on topic-counters |
rebased. |
@galak Thanks 👍 |
e8d4de9 to
bcedfc4
Compare
@nordic-krch I did the changes your required in the last iterations of these patches, could you please acknowledge you change requests and close them? Unless you have more comments 😄 |
2e57cff to
215f872
Compare
215f872 to
6b96890
Compare
|
@fvincenzo It looks like some non-counter related stuff slipped into this PR since you submitted it from fvincenzo:master. Will you please move the counter patches to their own branch and resubmit the PR? |
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.
please align to latest changes set_wrap -> set_top_value, get_wrap->get_top_value
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.
The fact that CI is still passing suggests that we're not building this driver in CI. @fvincenzo will you please add counter to the supported list in the appropriate <board>.yaml file? Like this:
zephyr/boards/arm/frdm_kw41z/frdm_kw41z.yaml
Lines 9 to 12 in 817c74f
| supported: | |
| - ieee802154 | |
| - adc | |
| - counter |
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.
if counter_config_info is correctly set you don't need to provide this function as it will be never called if counter_config_info indicates that there is not channels. See counter_set_channel_alarm in counter.h
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.
name has changed.
|
@fvincenzo i added couple of minor comments. Please rebase on latest topic-counters and update the code. I think that build is green because this driver is never compiled. You could try to add a board to test so that it's verified. |
@nordic-krch thanks for adding the comments. It is quite strange though, the code has been tested on beetle locally for all the drivers I submitted in this pull request and works correctly. I do not like to push untested code for review. Said that I think that the situation is getting confusing (at least on my side 😄): my tree is currently rebased on origin/topic-counters as per your request and it is how I tested my code. Am I doing anything wrong? |
|
@fvincenzo that is indeed strange. counter api struct has no Line 111 in 26b5136
And in your code you are setting it in the driver. So would expect that compilation will fail 😄 |
@nordic-krch Well then we have to work out why this is happening 😄. So are we sure that the topic branch is This is what the datastructure looks like (top commit |
|
@fvincenzo you are missing 6 commits in origin/topic-counters: https://github.com/zephyrproject-rtos/zephyr/commits/topic-counters |
@nordic-krch This commits were put on the tree after I updated my pull request (this explains)... Anyway, since the interface changed several times from last September (and I have been rebasing few times to accomodate it), how about you freeze it and than we start the porting of the drivers, otherwise it will always be a race behind you... 😄 |
|
@fvincenzo sorry for that, unfortunately for driver maintainers there are still active discussions so api will change again but we want to get to master with current api and do the second round once there is a conclusion. |
d71a3fd to
db34d5f
Compare
@nordic-krch That is fine by me. Changing an API is a complex process... and it is better to get it right. From the process stand point, I believe that the drivers porting should start only when the API reaches a versioned (i.e. 1.0) state. So that a driver can be declared compliant with a certain version. When are you going to release the first version? |
|
could you rebase your PR so we can merge it? I see that it contains additional 21 commits that shouldn't be there. |
rebased |
@fvincenzo It's freezed for now until we go to master. please apply comments so we can merge it. |
|
@MaureenHelm, @nordic-krch can you guys re-review. |
Add a label property so we can use that in drivers rather than getting from Kconfig. Signed-off-by: Kumar Gala <[email protected]>
The CMSDK Timer can be used as a timer or as a counter. The unified interface proposed in zephyrproject-rtos#8340 unifies counter.h and rtc.h to provide a common interface. This patch modifies the timer implementation of the single timer to make it compliant with the new proposed interface. Signed-off-by: Vincenzo Frascino <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
The CMSDK Dual Timer can be used as a timer or as a counter. The unified interface proposed in zephyrproject-rtos#8340 unifies counter.h and rtc.h to provide a common interface. This patch modifies the timer implementation of the dual timer to make it compliant with the new proposed interface. Signed-off-by: Vincenzo Frascino <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
Enable testing of counter (COUNTER_{D}TMR_CMSDK) on mps2_an385 and
enable timers on v2m_beetle (TIMER_{D}TMR_CMSDK).
Signed-off-by: Kumar Gala <[email protected]>
Convert cmsdk driver to use new defines so we can remove the dts_fixup.h code for it. Signed-off-by: Kumar Gala <[email protected]>
|
@nordic-krch @MaureenHelm can you guys re-review. |
nordic-krch
left a comment
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.
approve with 2 minor comments (seems like description is not updated after taking it from template).
| label: | ||
| type: string | ||
| category: required | ||
| description: Human readable string describing the device (used by Zephyr for API name) |
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.
should that be here?
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.
Meaning?
| label: | ||
| type: string | ||
| category: required | ||
| description: Human readable string describing the device (used by Zephyr for API name) |
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.
should that be here?
The CMSDK Timers (Single/Dual) can be used as a timer or as a counter. The unified interface proposed in #8340 unifies counter.h and rtc.h to provide a common interface.
This patchset makes the CMSDK Timers drivers compliant with the new proposed interface.
Changes:
v5:
v4:
v3:
v2: