sys/trickle: migrate from xtimer to ZTIMER_MSEC#16322
sys/trickle: migrate from xtimer to ZTIMER_MSEC#16322cgundogan merged 3 commits intoRIOT-OS:masterfrom
Conversation
|
All in all a valid change. But your PR shows up a problem, if just |
|
Yap, but this is IMHO more a generic problem with the ztimer deps. I proposed a generic fix in #16334, lets see if it gets in :-) |
|
On top there is a problem in the But as it seems the calculation of the remaining trickle time is based on a xtimer function that does not exist for ztimer, so there is no easy drop-in replacement. Will need to think of a viable approach to migrate that piece of code. |
|
After thinking about it, I will adapt this PR as well to be 'dual-timer', so to use ztimer only if its included in the build anyway and fallback to xtimer in any other case... |
af0a5bb to
54f177e
Compare
|
Adapted this PR to follow the same style as #16340 and #16339: @jue89 This should also rule out the dependency problem we discussed. |
54f177e to
6d6a28f
Compare
|
rebased |
6d6a28f to
511aebd
Compare
|
rebased |
|
The code changes look reasonable. Just a quick question on how to test this .. I wanted to run the I was testing with |
For |
mhh, okay. Works with the following diff: diff --git a/tests/trickle/Makefile b/tests/trickle/Makefile
index 72efd754bc..5512f1cb0d 100644
--- a/tests/trickle/Makefile
+++ b/tests/trickle/Makefile
@@ -1,5 +1,7 @@
include ../Makefile.tests_common
USEMODULE += trickle
+USEMODULE += ztimer_usec
+USEMODULE += ztimer_msec
include $(RIOTBASE)/Makefile.includeThe print output of the test also looks correct. I'd be fine with merging if there are no unresolved discussions (from above). |
cgundogan
left a comment
There was a problem hiding this comment.
Reasonable code changes and the tests/trickle test shows expected results.
|
The Github action figured out just fine that the PR needs squashing. No need to set the label and possibly waste valuable CI time as such ;-). |
511aebd to
ef8753a
Compare
|
squashed. |
|
Some |
sys/shell/commands/sc_gnrc_rpl.c
Outdated
| gnrc_rpl_instances[i].mop, gnrc_rpl_instances[i].of->ocp, | ||
| gnrc_rpl_instances[i].min_hop_rank_inc, gnrc_rpl_instances[i].max_rank_inc); | ||
|
|
||
| #if !IS_USED(MODULE_XTIMER) |
There was a problem hiding this comment.
Hmm, if there is no better way to access the current time-to-fire of the timer, then we should probably remove the TC print in both cases. It was there for debugging purposes and is not very important to have that around.
There was a problem hiding this comment.
No, to my knowledge there is not really a decent way with ztimer to get the TC. Removing all-together sounds good to me, will adapt.
84b5384 to
1fb34b3
Compare
|
The changes still look good after the amendments. |
Contribution description
This PR migrates
tricklefrom xtimer toZTIMER_MSEC. This allows for a) slightly simpler code, and b) for potential energy savings asxtimercan (at one point) be left out of a GNRC build.The acutal changes are pretty straight forward, no surprises here :-)
Testing procedure
Running the
test/trickletest should suffice.Issues/PRs references
none