diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-07-06 21:12:50 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-07-06 21:12:50 +0000 |
commit | 04683ac24576d53a97a8e8779581398107790c2c (patch) | |
tree | b94b05d51c4277b51b721011da5cf45469b19325 /os | |
parent | 9b9e7833b19414060061d47a17acdf6015a9dbdd (diff) | |
download | ChibiOS-04683ac24576d53a97a8e8779581398107790c2c.tar.gz ChibiOS-04683ac24576d53a97a8e8779581398107790c2c.tar.bz2 ChibiOS-04683ac24576d53a97a8e8779581398107790c2c.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7011 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c index 27bc79137..640515e4a 100644 --- a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c +++ b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c @@ -132,6 +132,14 @@ static void rtc_decode_time(uint32_t tr, RTCDateTime *timespec) { */
static void rtc_decode_date(uint32_t dr, RTCDateTime *timespec) {
+ timespec->year = RTC_BASE_YEAR +
+ (((dr >> RTC_DR_YT_OFFSET) & 15) * 10) +
+ ((dr >> RTC_DR_YU_OFFSET) & 15);
+ timespec->month = (((dr >> RTC_TR_MNT_OFFSET) & 1) * 10) +
+ ((dr >> RTC_TR_MNU_OFFSET) & 15);
+ timespec->day = (((dr >> RTC_DR_DT_OFFSET) & 3) * 10) +
+ ((dr >> RTC_DR_DU_OFFSET) & 15);
+ timespec->dayofweek = (dr >> RTC_DR_WDU_OFFSET) & 1;
}
/**
|