Skip to content

sys/ztimer: add ztimer64_xtimer_compat complete xtimer replace module#17670

Merged
kaspar030 merged 3 commits intoRIOT-OS:masterfrom
fjmolinas:pr_ztimer_xtimer_copmat_64
Feb 24, 2022
Merged

sys/ztimer: add ztimer64_xtimer_compat complete xtimer replace module#17670
kaspar030 merged 3 commits intoRIOT-OS:masterfrom
fjmolinas:pr_ztimer_xtimer_copmat_64

Conversation

@fjmolinas
Copy link
Copy Markdown
Contributor

Contribution description

This PR makes ztimer_xtimer_compat use ztimer64_usec implementing all xtimer api, with this ztimer64_usec can be used as a drop-in replacement for xtimer.

Testing procedure

Issues/PRs references

Split from #17365

@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 17, 2022
@github-actions github-actions bot added Area: Kconfig Area: Kconfig integration Area: sys Area: System Area: tests Area: tests and testing framework Area: timers Area: timer subsystems labels Feb 17, 2022
@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 Feb 18, 2022
@fjmolinas
Copy link
Copy Markdown
Contributor Author

@leandrolanzieri do you mind taking a quick look I changed some of the xtimer/ztimer modelings, and I want to be sure I'm not re-introducing issues.

@fjmolinas fjmolinas force-pushed the pr_ztimer_xtimer_copmat_64 branch from 4e6f9f7 to 28b6c93 Compare February 21, 2022 07:31
@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 Feb 21, 2022
@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 labels Feb 21, 2022
@github-actions github-actions bot added the Area: network Area: Networking label Feb 21, 2022

# use timer peripheral unless ztimer compatibility module is used
select MODULE_PERIPH_TIMER if HAS_PERIPH_TIMER && !MODULE_XTIMER_ON_ZTIMER && !MODULE_ZTIMER_XTIMER_COMPAT
select MODULE_PERIPH_TIMER if HAS_PERIPH_TIMER
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the idea of this was not to force the timer backend when compatibility is in place, leaving the option of the hardware to the Ztimer config. Why does this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmmm let me revert it and remember why hahaha

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will split out in another commit if justfied

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm well all green

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@leandrolanzieri does everything else Kconfig related look good to you?

depends on HAS_PERIPH_TIMER
depends on TEST_KCONFIG
select MODULE_PERIPH_TIMER if HAS_PERIPH_TIMER
# select MODULE_PERIPH_TIMER if HAS_PERIPH_TIMER
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should remove this line then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The comment? yes, that means you still keep

    select MODULE_PERIPH_TIMER if HAS_PERIPH_TIMER && !MODULE_XTIMER_ON_ZTIMER && !MODULE_ZTIMER_XTIMER_COMPAT

right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I meant removing the comments, ti was a note for myself when rebasing.

@fjmolinas
Copy link
Copy Markdown
Contributor Author

@kaspar030 could you give this one a look? IMO its missing only a rebase, squash, uncrustify the header file and this #17670 (comment)

@fjmolinas
Copy link
Copy Markdown
Contributor Author

Maybe @kfessel wants to take a look as well

@github-actions github-actions bot removed the Area: network Area: Networking label Feb 23, 2022
@fjmolinas
Copy link
Copy Markdown
Contributor Author

I added as asked for a ztimer64/xtimer_compat.h" header, but I also removed compatusage fromevent/timeout`, its honestly simply not worth the effort anymore to keep both. Let's see what Murdock thinks.

In a follow up what I'll do is enable ztimer_xtimer_compat by default, see which modules actually require the whole API, and have those explicitly select ztimer64_xtimer_compat.

@github-actions github-actions bot added the Area: build system Area: Build system label Feb 23, 2022
@fjmolinas fjmolinas removed the Area: build system Area: Build system label Feb 23, 2022
@fjmolinas
Copy link
Copy Markdown
Contributor Author

In a follow up what I'll do is enable ztimer_xtimer_compat by default, see which modules actually require the whole API, and have those explicitly select ztimer64_xtimer_compat.

So I'm modeling ztimer64_xtimer_compat as an "extension", both modules are pseudomodules anyway, but having it this way makes it easy to model in Make and Kconfig, since there will be no ifeq dependencies.

@kfessel kfessel self-requested a review February 23, 2022 10:45
@kfessel kfessel changed the title sys/ztimer: update ztimer_xtimer_compat_64 to use ztimer64 sys/ztimer: add ztimer64_xtimer_compat complete xtimer replace module Feb 23, 2022
@fjmolinas
Copy link
Copy Markdown
Contributor Author

@kaspar030 @kfessel I'll split the event_timeout not supporting ztimer PR out.

return ztimer64_now(ZTIMER64_USEC);
}


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change

some static test does not like that empty line

@fjmolinas fjmolinas force-pushed the pr_ztimer_xtimer_copmat_64 branch from 67a3e10 to 8555df0 Compare February 23, 2022 12:45
@github-actions github-actions bot added the Area: build system Area: Build system label Feb 23, 2022
@kfessel
Copy link
Copy Markdown
Contributor

kfessel commented Feb 23, 2022

somthing went wrong (event/timeout.c got added)

@fjmolinas fjmolinas force-pushed the pr_ztimer_xtimer_copmat_64 branch from 8555df0 to 03cec76 Compare February 23, 2022 13:21
@fjmolinas
Copy link
Copy Markdown
Contributor Author

somthing went wrong (event/timeout.c got added)

ups wrong rebase, re-added

@fjmolinas
Copy link
Copy Markdown
Contributor Author

Well all green

Copy link
Copy Markdown
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

ACK.

Copy link
Copy Markdown
Contributor

@kfessel kfessel left a comment

Choose a reason for hiding this comment

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

two nitpicks,
i think you can squash them right in and skip the murdock build

kaspar030 and others added 3 commits February 24, 2022 09:10
@fjmolinas fjmolinas force-pushed the pr_ztimer_xtimer_copmat_64 branch from 03cec76 to 46fe917 Compare February 24, 2022 08:11
@fjmolinas
Copy link
Copy Markdown
Contributor Author

Squashed in both nitpicks @kfessel

@fjmolinas
Copy link
Copy Markdown
Contributor Author

All green @kaspar030 @kfessel

@kaspar030 kaspar030 merged commit f2d7a04 into RIOT-OS:master Feb 24, 2022
@fjmolinas
Copy link
Copy Markdown
Contributor Author

Thanks, @kaspar030 @kfessel!

@fjmolinas fjmolinas deleted the pr_ztimer_xtimer_copmat_64 branch March 24, 2022 08:31
@OlegHahm OlegHahm added this to the Release 2022.04 milestone Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: Kconfig Area: Kconfig integration 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 CI: run tests If set, CI server will run tests on hardware for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants