-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[drivers][rtc] fix rtc assert #9804
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
Conversation
@@ -263,8 +263,6 @@ static int rt_soft_rtc_init(void) | |||
|
|||
rt_device_register(&soft_rtc_dev, "rtc", RT_DEVICE_FLAG_RDWR); | |||
|
|||
source_device = &soft_rtc_dev; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有看懂 麻烦增加一些解释 这里为什么删除了这行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原本是这样的,在软件rtc驱动中有个rt_soft_rtc_sync,但是其中的source_device句柄是没有进行初始化的,所以这里把这个句柄传递了下,但是后面看了看,dev_soft_rtc.c这个驱动文件中,还调用了硬件驱动的ops,这块感觉还是需要独立开的;
除此之外,rt_soft_rtc_sync是通过一个工作队列的机制去做的同步,原本的驱动之所以有source_device和soft_rtc_dev两个设备句柄,我感觉是为了这个rtc也能够同步硬件rtc设备,但是不应该放在这里一起去弄,本身也不合理;
我这里又重新提交了一份,现在看应该会清晰些,rtc的同步就暂时给软件rtc去使用,硬件的话不需要应该问题也不大,本身是硬件的机制,容错率更高。
后面的几次 PR 将 |
搞乱了是什么意思,有哪块出现问题了吗,请给出一个举例 |
soft_rtc 可作为系统时钟,定时同步到硬件时钟(硬件 RTC)上, 你都把这个机制都删除了. 请参考 linux 的操作 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up