Skip to content

sys/ztimer: adds some aggressive powersaving MACROS#16969

Draft
kfessel wants to merge 1 commit intoRIOT-OS:masterfrom
kfessel:p-use-less-power
Draft

sys/ztimer: adds some aggressive powersaving MACROS#16969
kfessel wants to merge 1 commit intoRIOT-OS:masterfrom
kfessel:p-use-less-power

Conversation

@kfessel
Copy link
Copy Markdown
Contributor

@kfessel kfessel commented Oct 8, 2021

that makes one able to decide whether
ztimer should keep running when no timer is active

THIS IS definitely a DRAFT

Contribution description

layerd ztimers like SEC or MSEC on USEC disable the pm_layed power-saving for their base-clock since they require 32Bit while less are left after the conversion -> they will employ the 32Bit Timer extender.

The POWERSAFE_ULTRA define will not keep the clock running if there is no Timer.

If pm_layerd is employed only clock with active timers are definitely working

Testing procedure

test/ztimer_xsec is still working. CFLAGS=-DPOWERSAFE_ULTRA make flash term

Issues/PRs references

#16327
#16891

THIS IS definetly a DRAFT

that makes one able to decide weather
ztimer should keep running when no timer is active
@jue89
Copy link
Copy Markdown
Contributor

jue89 commented Jan 28, 2022

Good idea! I had a quite similar one while designing a concept for #16327. But I guess we would get a problem, if ztimer_periph_* has to be extended and doesn't stall on clock->ops->cancel() because clock->checkpoint looses track of the peripheral's count that may overflow. Or am I wrong?

In my case, I'm using a ztimer_periph_timer based on a EFM32 LETIMER as ZTIMER_MSEC source. It has a width of 24 bits and must be extended. For the ZTIMER_USEC I'm also using a ztimer_periph_timer but based on an EFM32 TIMER. This timer doesn't need to be extended. Your draft may interfere with the required extension of ZTIMER_MSEC.

@jue89
Copy link
Copy Markdown
Contributor

jue89 commented Feb 2, 2022

I've tried to pick up your idea: #17607

Basically, this PR counts how many users are there for a specific clock and only keeps extending them if there are any users relying on this clock. Otherwise it turns off the peripheral.

@stale
Copy link
Copy Markdown

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: sys Area: System Area: timers Area: timer subsystems State: stale State: The issue / PR has no activity for >185 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants