Skip to content

Conversation

@benpicco
Copy link
Contributor

@benpicco benpicco commented Dec 16, 2025

Contribution description

xtimer_compat.h now always provides an xtimer implementation, even if no timer backend is used at all (then falls back to busy waiting).

This means we can use the xtimer API as a zero-cost abstraction to any timer backend wherever no particular timer is required.

Testing procedure

No changes in code expected when the existing ztimer backends are used.

Issues/PRs references

based on #20494

@github-actions github-actions bot added the Area: drivers Area: Device drivers label Dec 16, 2025
@benpicco benpicco requested review from fabian18 and maribu December 16, 2025 12:24
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 16, 2025
@benpicco benpicco requested review from Enoch247 and crasbe December 16, 2025 12:25
@riot-ci
Copy link

riot-ci commented Dec 16, 2025

Murdock results

FAILED

a9bb09b drivers/hm330x: make use of xtimer

Success Failures Total Runtime
213 0 9949 01m:13s

Artifacts

@maribu
Copy link
Member

maribu commented Dec 16, 2025

That is indeed a lot simpler. Can we also just remove the actual xtimer implementation?

E.g. also stuff like xtimer_usec_from_ticks() or so?

@crasbe crasbe added the Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation label Dec 16, 2025
@Enoch247
Copy link
Contributor

This does simplify the driver quite a bit. The only thing is, xtimer is deprecated. Shouldn't this go the other way, and move to ztimer only?

@benpicco
Copy link
Contributor Author

The only thing is, xtimer is deprecated.

Only the xtimer implementation is deprecated and can be removed (#21960)
The xtimer API is fine, it works well as a high-level abstraction for ztimer.

Shouldn't this go the other way, and move to ztimer only?

We definitely don't want to add more of this clutter to the codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants