diff options
Diffstat (limited to 'rtc/s3c24x0_rtc.c')
-rw-r--r-- | rtc/s3c24x0_rtc.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/rtc/s3c24x0_rtc.c b/rtc/s3c24x0_rtc.c index bf8008d..9e2191e 100644 --- a/rtc/s3c24x0_rtc.c +++ b/rtc/s3c24x0_rtc.c @@ -80,13 +80,15 @@ void rtc_get (struct rtc_time *tmp) SetRTC_Access(RTC_ENABLE); /* read RTC registers */ - sec = rtc->BCDSEC; - min = rtc->BCDMIN; - hour = rtc->BCDHOUR; - mday = rtc->BCDDATE; - wday = rtc->BCDDAY; - mon = rtc->BCDMON; - year = rtc->BCDYEAR; + do { + sec = rtc->BCDSEC; + min = rtc->BCDMIN; + hour = rtc->BCDHOUR; + mday = rtc->BCDDATE; + wday = rtc->BCDDAY; + mon = rtc->BCDMON; + year = rtc->BCDYEAR; + } while (sec != rtc->BCDSEC); /* read ALARM registers */ a_sec = rtc->ALMSEC; @@ -170,7 +172,7 @@ void rtc_reset (void) S3C24X0_RTC * const rtc = S3C24X0_GetBase_RTC(); rtc->RTCCON = (rtc->RTCCON & ~0x06) | 0x08; - rtc->RTCCON &= ~0x08; + rtc->RTCCON &= ~(0x08|0x01); } /* ------------------------------------------------------------------------- */ |