在线时间447 小时
UID3267972
ST金币1822
蝴蝶豆17
注册时间2016-5-3
该用户从未签到
论坛元老
- 最后登录
- 2022-5-20
|
楼主 |
发表于 2019-12-26 11:38:31
|
显示全部楼层
HAL_RTC_GetDate(&hrtc, &rtcDate, RTC_FORMAT_BIN);
HAL_RTC_GetTime(&hrtc, &rtcTime, RTC_FORMAT_BIN);
之前只是读时间,所以出错了。改成读日期+读时间,就可以了。但不知道为什么那样不行,为什么这样行?
--------------------------------------------------------------
搜到了,函数说明:
* @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.
意思是好像读了才更新?
|
|