关于 STM32 HAL 库读取 RTC 时间,数据不更新的问题

* @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
  *        to ensure consistency between the time and date values.

说的很清楚了,在调用 HAL_RTC_GetTime() 后,要再调用 HAL_RTC_GetDate() 才能更新时间。 论 读注释的重要性 🙂

参考 STM32 HAL库读取RTC时钟一直不更新时间的问题


Add Your Comment

* Indicates Required Field

Your email address will not be published.

*