[riot-notifications] [RIOT-OS/RIOT] event/timeout: remove forced ZTIMER_USEC dependency (#16892)

Hauke Petersen notifications at github.com
Fri Sep 24 19:05:46 CEST 2021

### Contribution description
This PR is (for now) simply a rough draft on how #16891 could be addressed. The goal is to remove the forced `ZTIMER_USEC` dependency from `event/timeout`, as this disables low-power modes on many platforms, even if the `USEC` timer is actually never used in the build...

The idea is to change the style of back-end timer selection a little bit for this module:
1. `ztimer` is always preferred -> so if `ztimer` is included in the build, it is automatically selected as backend. In the majority of RIOT builds, this is most likely the case by now...
2. per default, `event_timeout_init()` is not available. If modules (still) use this, it must be actively enabled by declaring a dependency on `event_timeout_legacy`.

- the `event_timeout_ztimer` module can be removed
- existing dependencies to `event_timeout` must be changed to depend on `event_timeout_legacy`
- step-by-step, modules like e.g. `gcoap` or `dhcp_client` shoudl be migrated to use the `event_timeout_ztimer_x()` functions, possibly while migrating the complete modules to `ztimer` :-)

So what do you think?

### Testing procedure
n/a as of now

### Issues/PRs references
fixes #16891 
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * <a href="https://github.com/RIOT-OS/RIOT/pull/16892/commits/224eea1cd1c60a0449f2a762bacbe334ebd18c02">event/timeout: do not foced ZTIMER_USEC dep</a>
  * <a href="https://github.com/RIOT-OS/RIOT/pull/16892/commits/ad61b35894b1f9d8b7a1fd6691c194fdc6ec4fe2">gcoap: use event_timeout_ztimer_x()</a>

-- File Changes --

    M sys/Makefile.dep (2)
    M sys/event/timeout.c (12)
    M sys/include/event/timeout.h (8)
    M sys/net/application_layer/gcoap/gcoap.c (14)

-- Patch Links --


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/6dfdd580/attachment.htm>

More information about the notifications mailing list