aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/RTCv1
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-03-06 14:19:46 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-03-06 14:19:46 +0000
commit8d1dc1313cf3d1ce8f7793d037c1df0c0591dc8c (patch)
tree00d891d2e5199da0094cf70108f04bdb0262089f /os/hal/ports/STM32/LLD/RTCv1
parent81675a02592a8b946e8512d92f7be26588da959b (diff)
downloadChibiOS-8d1dc1313cf3d1ce8f7793d037c1df0c0591dc8c.tar.gz
ChibiOS-8d1dc1313cf3d1ce8f7793d037c1df0c0591dc8c.tar.bz2
ChibiOS-8d1dc1313cf3d1ce8f7793d037c1df0c0591dc8c.zip
RTCv1 synchronization tentative fix.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10119 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/LLD/RTCv1')
-rw-r--r--os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c b/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c
index 27689839d..9fe6417b2 100644
--- a/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c
+++ b/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c
@@ -399,6 +399,9 @@ void rtcSTM32GetSecMsec(RTCDriver *rtcp, uint32_t *tv_sec, uint32_t *tv_msec) {
/* Required because access to CNT and DIV.*/
rtc_apb1_sync();
+ /* wait for previous write accesses to complete.*/
+ rtc_wait_write_completed();
+
/* Loops until two consecutive read returning the same value.*/
do {
*tv_sec = ((uint32_t)(rtcp->rtc->CNTH) << 16) + rtcp->rtc->CNTL;