Skip to content

fix: ability to set alarm after reset #77

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

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

ABOSTM
Copy link
Contributor

@ABOSTM ABOSTM commented Sep 27, 2022

fix: ability to set alarm after reset

Be sure to set default value for alarmday,
and thus avoid IS_RTC_DATE(day) being false
when is not usd in alarm setting

Take into account Reset usecase
(being able to set new alarma after a reset)

Factorize change of RTC clock source in the RTC_begin() function which imply a reset of BackupDomain.
Save configuration before this BackupDomain reset, and restore after.

Tested with sketches from RTC and LowPower libraries,
on both Nucleo F103RB and Nucleo L476RG

fixes stm32duino/STM32LowPower#82

@ABOSTM ABOSTM requested a review from fpistm September 27, 2022 13:05
@fpistm fpistm added bug enhancement New feature or request labels Sep 28, 2022
@fpistm fpistm added this to the 1.3.2 milestone Sep 28, 2022
@tshcherban
Copy link

You meant that #82?

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo else LGTM

Be sure to set default value for alarmday,
and thus avoid IS_RTC_DATE(day) being false
when is not usd in alarm setting

Take into account Reset usecase
(being able to set new alarma after a reset)

Factorize change of RTC clock source in the RTC_begin() function
which imply a reset of BackupDomain.
Save configuration before this BackupDomain reset,
and restore after.

fixes stm32duino#82

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
@ABOSTM ABOSTM force-pushed the SET_ALARM_AFTER_RESET branch from 92a1c5d to c2700eb Compare September 28, 2022 08:47
@ABOSTM
Copy link
Contributor Author

ABOSTM commented Sep 28, 2022

You meant that #82?

yes

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks for this great PR 😉

@fpistm fpistm merged commit d9dc7ba into stm32duino:main Sep 28, 2022
@fpistm fpistm added bug 🐛 Something isn't working fix 🩹 Bug fix and removed bug bug 🐛 Something isn't working labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix 🩹 Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Never waking up when alarm is set without reseting RTC
3 participants