Skip to content

event/timeout: fixed dependency on ZTIMER_USEC preventing low-power operation #16891

@haukepetersen

Description

@haukepetersen

Description

For testing some border router stuff I just wanted to re-flash one of my very-low-power nodes with a current firmware. But it turns out, that with current master I am not able anymore to get my low-power build to work... To recap: key to this build was to get rid of any xtimer and ztimer_usec depencency, as a running periph timer does prevent the Nordic from going to low power...

The reason that is blocking my build now is the usage of event/timeout in gcoap. More precisely: the recent ztimer-enabling of event/timeout (#16505) introduces a fixed dependency to ztimer_usec - leading to gcoap always pulling in and enabling the periph timer...

Possible solution:
The API changes/additions to event/timeout already contain new ztimer-specific functions that let the user decide for the time backend to use. So the problem is the mapping of the existing API functions, which are however always included in the build. The key to solving this problem lies IMHO in separating the ztimer and non-ztimer parts of the event/callback API more strictly: modules using this library should either use only the event_timeout_ztimer_x() API and declare that dependency by using event_timeout_ztimer, or they should use the old, usec-based API, declaraing this by depending on event_timeout. Now it becomes possible to use that module without forcing ZTIMER_USEC into the build...

Steps to reproduce the issue

build anything with gcoap, xtimer or ztimer_usec are always pulled into the build

Expected results

Use event/timeout and gcoap in low-power applications

Actual results

low-power not possible with gcoap at the moment

Versions

master

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions