在开启RTC后,频繁读取RTC时间,出现在跨天的时候天数无法累加,不知道有没有小伙伴遇到同样的问题? (例如时间19-01-01 23:59:50->19-01-02 00:00:02的过程成,频繁读取RTC时间,基本为1S读一次,在跨天后读取出来的时间值为19-01-01 00:00:01) 不知道这由什么问题导致的? RTC_Wait_For_Synchro();//Waiting for synchronization RTC_Date_TYPE *pDate = (RTC_Date_TYPE *)&RTC->DR; RTC_Time_TYPE *pTime = (RTC_Time_TYPE *)&RTC->TR; UINT16 tmpreg = RTC->SSR; rtc->SSeconds = ((RTC_SYNCHRONOUS_PRESCALER-tmpreg)*125)>>5; rtc->Year.ALL = pDate->Year; rtc->Month.ALL = pDate->Month&0x1f; rtc->Date.ALL = pDate->Date; rtc->Hours.ALL = pTime->Hours&0x3f; rtc->Minutes.ALL = pTime->Minutes; rtc->Seconds.ALL = pTime->Seconds; |
NFC天线设计工具
STM32L071 配置RTC为24小时制,13点的时候会变为1点
STM32L071CBT6低温环境下无法正常工作
nucleo-l053r8 BOARD NAME修改
各位好,我遇到了一个问题,一直没有解决,关于STM32L071 bank问题
STM32L073RZT6 PA2不能置1
STM32L07系列低功耗串口应用
stm32L0系列串口稳定性
谁有STM32L051的数据手册RM0377和编程手册PM0223的中文版,
查之前我的提问
先读日期再读时间就会有这种问题吗?
hal的库也都只是独立封装出来,效果应该都是一样的吧
in the higher-order calendar shadow registers to ensure consistency between the time and date values.
Reading RTC current time locks the values in calendar shadow registers until Current date is read.
官方note
You must call HAL RTC GetDate() after HAL RTC GetTime() to unlock the values
in the higher-order calendar shadow registers to ensure consistency between the time and date values.
Reading RTC current time locks the values in calendar shadow registers until Current date is read.