aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
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 */