Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for wakeup via RTC wakeup timer #27

Merged
merged 8 commits into from Aug 14, 2019
Merged

Add support for wakeup via RTC wakeup timer #27

merged 8 commits into from Aug 14, 2019

Conversation

hannobraun
Copy link
Contributor

@hannobraun hannobraun commented Aug 13, 2019

As the title says, this pull requests adds support for waking up from low-power modes using the RTC wakeup timer. In addition it adds some fixes of and improvements upon my previous RTC PR.

It also makes some changes to the EXTI API that are required to support the RTC wakeup timer. The new capabilities are basically duct-taped on top of the old ones, which leads to some weird issues (like the listen's port argument being ignored when it doesn't make sense).

This is far from the ideal approach, and I believe there's a possible EXTI API that is much more type-safe and has more natural support for non-GPIO interrupts. However, I don't have the time to figure that out right now.

I plan to go back and take a look at an EXTI redesign after I've completed some more urgent task. Probably late September or October.

cc @lthiery

hannobraun added 8 commits Aug 13, 2019
The values used for almost, but not quite, correct. I thought that I'd
set the two prescaler factors to 64 and 512 by writing those values, but
what I actually did was set them to 65 and 513, as per reference manual.

Those new values set them to 128 and 256, which are the values
recommended in a piece of documentation that I've previously missed,
which should set the clock frequency used by the calendar to a clean
1 Hz.
As far as I can tell, what was there before didn't match the
documentation. The new asserts match the supported bits on both
STM32L0x1 and STM32L0x2.
This is just the minimal change required to add support for the RTC
wakeup timer to RTC's `wait_for_irq` method.
@arkorobotics arkorobotics merged commit 1ebb318 into stm32-rs:master Aug 14, 2019
@hannobraun hannobraun deleted the rtc-wakeup branch Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants