[riot-notifications] [RIOT-OS/RIOT] event/timeout: fixed dependency on ZTIMER_USEC preventing low-power operation (#16891)

Hauke Petersen notifications at github.com
Fri Sep 24 18:28:46 CEST 2021

#### 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

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210924/d0c75432/attachment.htm>

More information about the notifications mailing list