aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-12-22 09:19:37 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-12-22 09:19:37 +0000
commit633cc9be98102aaf6e6ea07775f1b41f6c4fad2e (patch)
treeb9dccde5a79b1ab858578313095c6cc25528ee84
parent553c13c0f49c2c83259bdbd4e0321a08b2bce38a (diff)
downloadChibiOS-633cc9be98102aaf6e6ea07775f1b41f6c4fad2e.tar.gz
ChibiOS-633cc9be98102aaf6e6ea07775f1b41f6c4fad2e.tar.bz2
ChibiOS-633cc9be98102aaf6e6ea07775f1b41f6c4fad2e.zip
Fixed STM32 RTCv1 initialization problem.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7592 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c16
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.*/