From 41fd0fb5fb2d446605e7a99c11f46d7c28071500 Mon Sep 17 00:00:00 2001 From: barthess Date: Sun, 25 Sep 2011 10:03:59 +0000 Subject: RTC. API changes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3405 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/rtc.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'os/hal/src') diff --git a/os/hal/src/rtc.c b/os/hal/src/rtc.c index 3b4b5824b..0c8959ea6 100644 --- a/os/hal/src/rtc.c +++ b/os/hal/src/rtc.c @@ -83,36 +83,42 @@ void rtcSetCallback(RTCDriver *rtcp, rtccb_t overflowcb, /** * @brief Set current time. - * @param[in] tv_sec - time value in UNIX notation. + * + * @param[in] timespec pointer to variable storing time. */ -void rtcSetTime(uint32_t tv_sec){ - rtc_lld_set_time(tv_sec); +void rtcSetTime(RTCDateTime *timespec){ + chDbgCheck((timespec != NULL), "rtcSetTime"); + rtc_lld_set_time(timespec); } /** - * @brief Return return seconds since UNIX epoch. - * - * @param[in] msec pointer to variable for storing fractional part of - * time (milliseconds). + * @brief Get current time. * - * @notapi + * @param[in] timespec pointer to variable storing time. */ -inline uint32_t rtcGetTime(uint16_t *msec){ - return rtc_lld_get_time(msec); +void rtcGetTime(RTCDateTime *timespec){ + chDbgCheck((timespec != NULL), "rtcGetTime"); + rtc_lld_get_time(timespec); } /** - * @brief Set alarm date in UNIX notation. + * @brief Set alarm time. + * + * @param[in] timespec pointer to variable storing time of alarm. */ -void rtcSetAlarm(uint32_t tv_alarm){ - rtc_lld_set_alarm(tv_alarm); +void rtcSetAlarm(RTCDateTime *timespec){ + chDbgCheck((timespec != NULL), "rtcSetAlarm"); + rtc_lld_set_alarm(timespec); } /** - * @brief Get current alarm date in UNIX notation. + * @brief Get current alarm. + * + * @param[in] timespec pointer to variable to store alarm time. */ -inline uint32_t rtcGetAlarm(void){ - return rtc_lld_get_alarm(); +void rtcGetAlarm(RTCDateTime *timespec){ + chDbgCheck((timespec != NULL), "rtcGetAlarm"); + rtc_lld_get_alarm(timespec); } #endif /* HAL_USE_RTC */ -- cgit v1.2.3