diff options
Diffstat (limited to 'os/hal/ports')
-rw-r--r-- | os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c b/os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c index 1d02c353b..37fca80c1 100644 --- a/os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c +++ b/os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c @@ -60,7 +60,8 @@ RTCDriver RTCD1; * @notapi
*/
static void rtc_apb1_sync(void) {
- while ((RTCD1.rtc->CRL & RTC_CRL_RSF) == 0)
+
+ while ((RTC->CRL & RTC_CRL_RSF) == 0)
;
}
@@ -71,7 +72,8 @@ static void rtc_apb1_sync(void) { * @notapi
*/
static void rtc_wait_write_completed(void) {
- while ((RTCD1.rtc->CRL & RTC_CRL_RTOFF) == 0)
+
+ while ((RTC->CRL & RTC_CRL_RTOFF) == 0)
;
}
@@ -84,8 +86,9 @@ static void rtc_wait_write_completed(void) { * @notapi
*/
static void rtc_acquire_access(void) {
+
rtc_wait_write_completed();
- RTCD1.rtc->CRL |= RTC_CRL_CNF;
+ RTC->CRL |= RTC_CRL_CNF;
}
/**
@@ -94,7 +97,8 @@ static void rtc_acquire_access(void) { * @notapi
*/
static void rtc_release_access(void) {
- RTCD1.rtc->CRL &= ~RTC_CRL_CNF;
+
+ RTC->CRL &= ~RTC_CRL_CNF;
}
/**
@@ -189,8 +193,8 @@ void rtc_lld_set_prescaler(void) { sts = chSysGetStatusAndLockX();
rtc_acquire_access();
- RTCD1.rtc->PRLH = (uint16_t)((STM32_RTCCLK - 1) >> 16) & 0x000F;
- RTCD1.rtc->PRLL = (uint16_t)(((STM32_RTCCLK - 1)) & 0xFFFF);
+ RTC->PRLH = (uint16_t)((STM32_RTCCLK - 1) >> 16) & 0x000F;
+ RTC->PRLL = (uint16_t)(((STM32_RTCCLK - 1)) & 0xFFFF);
rtc_release_access();
/* Leaving a reentrant critical zone.*/
|