diff options
author | theshed <theshed@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-06-01 22:00:28 +0000 |
---|---|---|
committer | theshed <theshed@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-06-01 22:00:28 +0000 |
commit | 51af0586c9634da8dfb35c6c71e0726392c1fbb3 (patch) | |
tree | 43506df5154db29d232b02f8189871eacc975bc3 /os/various/chrtclib.c | |
parent | 62ae17087c620312a24a87ac7435a8c2257ab8b6 (diff) | |
download | ChibiOS-51af0586c9634da8dfb35c6c71e0726392c1fbb3.tar.gz ChibiOS-51af0586c9634da8dfb35c6c71e0726392c1fbb3.tar.bz2 ChibiOS-51af0586c9634da8dfb35c6c71e0726392c1fbb3.zip |
More LPC122x drivers from Marcin J.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5794 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/various/chrtclib.c')
-rw-r--r-- | os/various/chrtclib.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/os/various/chrtclib.c b/os/various/chrtclib.c index f775a786d..048f2c0dc 100644 --- a/os/various/chrtclib.c +++ b/os/various/chrtclib.c @@ -35,7 +35,7 @@ #if (defined(STM32F4XX) || defined(STM32F2XX) || defined(STM32L1XX) || \
defined(STM32F1XX) || defined(STM32F10X_MD) || defined(STM32F10X_LD) || \
- defined(STM32F10X_HD) || defined(__DOXYGEN__))
+ defined(STM32F10X_HD) || defined(LPC122X) || defined(__DOXYGEN__))
#if STM32_RTC_IS_CALENDAR
/**
* @brief Converts from STM32 BCD to canonicalized time format.
@@ -250,7 +250,7 @@ uint64_t rtcGetTimeUnixUsec(RTCDriver *rtcp) { * @api
*/
void rtcGetTimeTm(RTCDriver *rtcp, struct tm *timp) {
- RTCTime timespec = {0,0};
+ RTCTime timespec = {0};
rtcGetTime(rtcp, ×pec);
localtime_r((time_t *)&(timespec.tv_sec), timp);
@@ -265,10 +265,12 @@ void rtcGetTimeTm(RTCDriver *rtcp, struct tm *timp) { * @api
*/
void rtcSetTimeTm(RTCDriver *rtcp, struct tm *timp) {
- RTCTime timespec = {0,0};
+ RTCTime timespec = {0};
timespec.tv_sec = mktime(timp);
+#if !defined(LPC122X)
timespec.tv_msec = 0;
+#endif
rtcSetTime(rtcp, ×pec);
}
@@ -281,7 +283,7 @@ void rtcSetTimeTm(RTCDriver *rtcp, struct tm *timp) { * @api
*/
time_t rtcGetTimeUnixSec(RTCDriver *rtcp) {
- RTCTime timespec = {0,0};
+ RTCTime timespec = {0};
rtcGetTime(rtcp, ×pec);
return timespec.tv_sec;
@@ -297,10 +299,12 @@ time_t rtcGetTimeUnixSec(RTCDriver *rtcp) { * @api
*/
void rtcSetTimeUnixSec(RTCDriver *rtcp, time_t tv_sec) {
- RTCTime timespec = {0,0};
+ RTCTime timespec = {0};
timespec.tv_sec = tv_sec;
+#if !defined(LPC122X)
timespec.tv_msec = 0;
+#endif
rtcSetTime(rtcp, ×pec);
}
|