Skip to content

Use time_t instead of uint32_t to avoid year 2038 problem. #82

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
Dec 19, 2022

Conversation

paulbearddotname
Copy link
Contributor

No description provided.

@fpistm fpistm self-requested a review December 19, 2022 07:45
@fpistm fpistm added the enhancement New feature or request label Dec 19, 2022
@fpistm fpistm modified the milestones: 1.3.4, 1.3.5 Dec 19, 2022
@fpistm
Copy link
Member

fpistm commented Dec 19, 2022

Hi @paulbearddotname
Thanks for pointing and fixing this.

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.
In fact, I think we didn't had this problem as we used uint32_t and no int32_t.
Like time_t is defined as uin32_t it is the same. Anyway, if time_t is changed in the future then it will be compliant.

Note:
now we differ from RTCCZero:
https://github.com/arduino-libraries/RTCZero/blob/9a722372261e822ae418ef8ee60e9f3d8afd6f9f/src/RTCZero.h#L95-L98

For ref:
https://en.wikipedia.org/wiki/Year_2038_problem

@fpistm fpistm merged commit ea2898b into stm32duino:main Dec 19, 2022
ArrestedLightning pushed a commit to ArrestedLightning/STM32RTC that referenced this pull request Jan 6, 2023
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants