Skip to content
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

sys/evtimer,ztimer: do not depend on ztimer_now64 #17357

Merged
merged 14 commits into from
Dec 15, 2021

Conversation

kfessel
Copy link
Contributor

@kfessel kfessel commented Dec 8, 2021

Contribution description

evtimer uses 32 bits of msec -> there is no reason to pull ztimer_now64

Testing procedure

run evtimer tests evtimer_mbox, evtimer_msg, evtimer_underflow with USEMODULE=evtimer_on_ztimer

Issues/PRs references

@github-actions github-actions bot added Area: sys Area: System Area: timers Area: timer subsystems labels Dec 8, 2021
@kfessel
Copy link
Contributor Author

kfessel commented Dec 8, 2021

evtimer_underflow is failing with USEMODULE=evtimer_on_ztimer before and after this commit so there is a bug that this does not yet fix

@kfessel
Copy link
Contributor Author

kfessel commented Dec 8, 2021

i just saw there is a convenience function hidden in evtimer.h: evtimer_now_min i found one user of it who need 16bit (nib tracking the validit of not offline nibs (offline nibs are valid in milliseconds :wat: )

@kfessel
Copy link
Contributor Author

kfessel commented Dec 8, 2021

the loop in evtimer_underflow : main is blocking the timer that should be setup from triggering (in case of xtimer this is solved by xtimer_spin (which blocks the thread until the spin is over)

@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Dec 8, 2021
@fjmolinas
Copy link
Contributor

I can't really see why ztimer_now64 is needed either... lets give this one a spin... with tests ran, will do the same on my side.

@fjmolinas fjmolinas added CI: run tests If set, CI server will run tests on hardware for the labeled PR CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 10, 2021
@fjmolinas
Copy link
Contributor

@kfessel can you put a removeme commit to force evtimer_on_ztimer to be used?

@fjmolinas fjmolinas added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 13, 2021
@kfessel
Copy link
Contributor Author

kfessel commented Dec 13, 2021

every time i remove xtimer dependancy at one place i expose how xtimer depenacy is not expressed for other places

@fjmolinas
Copy link
Contributor

I had the test fail on samr21-xpro and hifive-1b with something like:

main(): This is RIOT! (Version: riot/pr/17357)
Testing generic evtimer
This should list 2 items
ev #1 offset=997
ev #2 offset=501
This should list 4 items
ev #1 offset=658
ev #2 offset=339
ev #3 offset=501
ev #4 offset=2456
Are the reception times of all 4 msgs close to the supposed values?
At   4327 ms received msg 0: "#2 supposed to be 4324"

@kfessel
Copy link
Contributor Author

kfessel commented Dec 13, 2021

@fjmolinas : do you mind testing with master and evtimer_on_ztimer

@kfessel kfessel requested a review from cgundogan as a code owner December 13, 2021 16:13
@kfessel kfessel force-pushed the p-evtimer32 branch 2 times, most recently from dc4f160 to f3e95f9 Compare December 14, 2021 13:12
Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, please squash and remove the forced dependency, the test failure was expected.

@fjmolinas fjmolinas removed the CI: run tests If set, CI server will run tests on hardware for the labeled PR label Dec 14, 2021
@kfessel
Copy link
Contributor Author

kfessel commented Dec 14, 2021

@fjmolinas fjmolinas enabled auto-merge December 14, 2021 17:22
@@ -58,6 +58,11 @@ void *worker_thread(void *arg)
}
}

void sleep_msec(uint16_t t)
{
ztimer_sleep(ZTIMER_MSEC, t);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should still be xtimer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash right away and re-trigger

Copy link
Contributor Author

@kfessel kfessel Dec 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did miss the disabled ci-flag :(

shall the runtest flag be added again?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the failures was unrelated, only ci-build is fine

@fjmolinas fjmolinas removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 14, 2021
@kfessel kfessel added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 15, 2021
@fjmolinas fjmolinas merged commit fe850e8 into RIOT-OS:master Dec 15, 2021
@fjmolinas fjmolinas added this to the Release 2022.01 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: examples Area: Example Applications Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Area: tests Area: tests and testing framework Area: timers Area: timer subsystems CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants