Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-src by
Diff: api/rtc_time.h
- Revision:
- 489:119543c9f674
- Parent:
- 13:0645d8841f51
--- a/api/rtc_time.h Thu Mar 05 13:15:07 2015 +0000 +++ b/api/rtc_time.h Thu Mar 12 14:30:49 2015 +0000 @@ -69,6 +69,17 @@ */ void set_time(time_t t); +/** Attach an external RTC to be used for the C time functions + * + * Do not call this function from an interrupt while an RTC read/write operation may be occurring + * + * @param read_rtc pointer to function which returns current UNIX timestamp + * @param write_rtc pointer to function which sets current UNIX timestamp, can be NULL + * @param init_rtc pointer to funtion which initializes RTC, can be NULL + * @param isenabled_rtc pointer to function wich returns if the rtc is enabled, can be NULL + */ +void attach_rtc(time_t (*read_rtc)(void), void (*write_rtc)(time_t), void (*init_rtc)(void), int (*isenabled_rtc)(void)); + #ifdef __cplusplus } #endif