aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-09-25 10:03:59 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-09-25 10:03:59 +0000
commit41fd0fb5fb2d446605e7a99c11f46d7c28071500 (patch)
tree36e62fdc404fdbbacf5139a547ff8ac0e4d5bc15 /os/hal/src
parent5edc2c8b69cd60a1c53b565e529e099c36a243c4 (diff)
downloadChibiOS-41fd0fb5fb2d446605e7a99c11f46d7c28071500.tar.gz
ChibiOS-41fd0fb5fb2d446605e7a99c11f46d7c28071500.tar.bz2
ChibiOS-41fd0fb5fb2d446605e7a99c11f46d7c28071500.zip
RTC. API changes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3405 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/rtc.c38
1 files changed, 22 insertions, 16 deletions
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 */