sys/ztimer: rename required_pm_mode to block_pm_mode#16160
sys/ztimer: rename required_pm_mode to block_pm_mode#16160kaspar030 merged 1 commit intoRIOT-OS:masterfrom
Conversation
sys/include/ztimer.h
Outdated
| union{ | ||
| uint8_t required_pm_mode; /**< min. pm mode required for the clock to run */ | ||
| uint8_t block_pm_mode; /**< min. pm mode to block for the clock to run */ | ||
| }; |
There was a problem hiding this comment.
I wonder if we really need backward compatibility here. Isn't this an internal API?
But if we really want this:
| union{ | |
| uint8_t required_pm_mode; /**< min. pm mode required for the clock to run */ | |
| uint8_t block_pm_mode; /**< min. pm mode to block for the clock to run */ | |
| }; | |
| union{ | |
| uint8_t required_pm_mode; /**< min. pm mode required for the clock to run */ | |
| uint8_t block_pm_mode; /**< min. pm mode to block for the clock to run */ | |
| }; |
There was a problem hiding this comment.
i am not sure how internal and not internal API is decided but core/lifo i going through a deprecation cycle for maybe beeing not internal even though no one could name a valid usecase
There was a problem hiding this comment.
I personaly think this is only used via the PM_MODE defines and therefor internal but since the require does not take up any space i am ok with deprecation and deletion
There was a problem hiding this comment.
Deprecation comes at a cost: This increases complexity and can cause confusion. Also, new users of deprecated API occasionally still pop up even many months after. So, if there is no (valid) external use, we should IMO avoid the effort.
Maybe @kaspar030 and @bergzand have an opinion on this?
I think in this case keeping the compatibility is not that expensive, but I don't think the header is clear enough, the union element should have a deprecated tag. But at the same time |
|
This one needs a rebase BTW |
c2ab655 to
56c7239
Compare
|
rebased (@maribu s sugestions are squash into the new intial commit) |
|
Murdock had some time (no builds running) therefor i added the (CI: ready for build) label: Murdock found no issues. |
|
there is still no response from @kaspar030 and/or @bergzand should i just remove the union thing? |
|
IMO just renaming would have been fine, but now the deprecation is there, also fine! What puzzles me more is that the anonymous union actually passed murdock. AFAIK they're c11 only, and our AVR toolchain doesn't support that? Is any ztimer code built on CI for AVR? |
Seems like AVR is actually on C11, so no blocker here. So, please squash! |
4c8edb0 to
20ae4bc
Compare
|
Murdock failed with (unrelated i think): |
|
Hm, this doesn't change any makefiles. Could you give this another rebase, then try restarting the build? |
20ae4bc to
8f0e47a
Compare
sys/include/ztimer.h
Outdated
| union { | ||
| uint8_t required_pm_mode; /**< min. pm mode required for the clock to run | ||
| * @deprecated name change -> block_pm_mode: | ||
| * this is used to block a pm_mode | ||
| * use block_pm_mode instead */ | ||
| uint8_t block_pm_mode; /**< min. pm mode to block for the clock to run */ | ||
| }; |
There was a problem hiding this comment.
Do we really consider this a user facing API that needs deprecation? IMO this is internal and we should just rename it and be done with it.
There was a problem hiding this comment.
so @kfessel, sorry for the confusion, please just remove the deprecation stuff...
There was a problem hiding this comment.
I'm also fine with just renaming it. This struct member is just touched by auto_init.c. At least in all my use cases ;)
There was a problem hiding this comment.
done (both variants are good from my pov)
8f0e47a to
951fa14
Compare
|
i removed the deprecation part |
|
@kaspar030 merge? |
|
next stop: round robin scheduling #16126 |
Contribution description
the mode that is stored in required_pm_mode would not keep clock running
but one mode higher therefor the timer needs to block that mode, the logic does it this way.
The define keeps it's name for compatiblity but its use should fade, when #15715 is merged,
and should be deprecated in the release after that.
this PR is backward compatible to previous name waiting for it to be deprecated and removed.
Testing procedure
build and test things that use pm_layerd and ztimer
Issues/PRs references
the name was introduced with #13722 maybe #13722 (comment)_ creted the name != function mismatch
this is in conflict with an other PR I am writing on: #15715 i will happily rebase either when the other is merged