components: drivers: rtc: add the alarm using local time for calculation#10361
Merged
Rbb666 merged 2 commits intoRT-Thread:masterfrom Jun 9, 2025
Merged
Conversation
2a23b08 to
f84ba70
Compare
- add the alarm using local time for calculation Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
f84ba70 to
9c44652
Compare
Contributor
|
Hi,作者您好。我在使用 STM32F407-RT-Spark 验证当前 PR 时,遇到了一个关于闹钟中断的问题。 我按照文档中的 Demo 进行了测试,并将设置闹钟时间的函数修改为了 localtime_r。运行发现无法触发闹钟中断。 检查后发现,当 RT_LIBC_TZ_DEFAULT_HOUR 默认设置为 8 (即 UTC+8) 时,闹钟中断无法触发。但当将其设置为 0 (即 UTC+0) 时,闹钟中断就能正常触发。看起来目前闹钟功能似乎只能在 UTC+0 时区下正常工作。 您那边能帮忙看看这个问题吗 |
Contributor
Author
…t stamp - include the year, month, and day for rtc_alarm_time_set API - add local time conversion for get timeval and set stamp Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
95aa5c5 to
8eaf252
Compare
Rbb666
approved these changes
Jun 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


为什么提交这份PR (why to submit this PR)
rtc的alarm驱动不支持带时区(local time)的时间比较闹钟事件触发
你的解决方案是什么 (what is your solution)
在kconfig中加入使用本地时间的alarm的配置,RT_ALARM_USING_LOCAL_TIME,默认不使能,也就是默认还是UTC时区闹钟。
另外rt_alarm_dump命令加入支持timezone显示,这样比较直观些。