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.
Dependencies: BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG TS_DISCO_F746NG FATFileSystem TinyJpgDec_interwork mbed-src
RTC.cpp
00001 #include "WakeupLight.h" 00002 00003 void RTC_Init(void) 00004 { 00005 rtc_init(); 00006 } 00007 00008 time_t RTC_Get(struct tm **tmStruct) 00009 { 00010 time_t result; 00011 00012 // rtc_read in IAR is buggy, it converts the rtc time to local time, sometimes with, sometimes without timezone 00013 result=time(NULL); 00014 localtime(&result); 00015 00016 result=time(NULL); 00017 00018 DPrintf_("RTC_Get: 0x%X.\r\n",result); 00019 00020 if (tmStruct!=NULL) 00021 (*tmStruct)=localtime(&result); 00022 00023 return result; 00024 } 00025 00026 void RTC_Set(struct tm *tmStruct) 00027 { 00028 time_t result; 00029 00030 result=mktime(tmStruct); 00031 00032 set_time(result); 00033 } 00034
Generated on Tue Jul 12 2022 21:40:04 by
1.7.2