MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / get_timestamp

Function get_timestamp

components/drivers/rtc/dev_rtc.c:260–273  ·  view source on GitHub ↗

* Get timestamp(UTC). * * @param time_t* timestamp * * @return rt_err_t if set success, return RT_EOK. */

Source from the content-addressed store, hash-verified

258 * @return rt_err_t if set success, return RT_EOK.
259 */
260rt_err_t get_timestamp(time_t *timestamp)
261{
262 if (_rtc_device == RT_NULL)
263 {
264 _rtc_device = rt_device_find("rtc");
265 if (_rtc_device == RT_NULL)
266 {
267 return -RT_ERROR;
268 }
269 }
270
271 /* Get timestamp from RTC device. */
272 return rt_device_control(_rtc_device, RT_DEVICE_CTRL_RTC_GET_TIME, timestamp);
273}
274
275#ifdef RT_USING_FINSH
276#include <finsh.h>

Callers 5

alarm_wakeupFunction · 0.70
alarm_updateFunction · 0.70
alarm_setupFunction · 0.70
rt_alarm_startFunction · 0.70
dateFunction · 0.70

Calls 2

rt_device_findFunction · 0.85
rt_device_controlFunction · 0.85

Tested by

no test coverage detected