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: mbos Watchdog TextLCD mbed ConfigFile
Task5SetTime.cpp
00001 #include "Task5SetTime.h" 00002 00003 void SetTimeTask(void) 00004 {/** 00005 *\brief TASK 5, Set RTC system time if the GPS time is valid 00006 */ 00007 struct tm t; 00008 00009 os.SetTimer(SET_TIME_TMR, 60000, 60000); 00010 while(1) 00011 { 00012 os.WaitEvent(SET_TIME_EVT); 00013 00014 if(info.sig != 0) 00015 { 00016 t.tm_mday=info.utc.day; 00017 t.tm_mon=info.utc.mon; 00018 t.tm_year=info.utc.year; 00019 t.tm_hour=info.utc.hour; 00020 t.tm_min=info.utc.min; 00021 t.tm_sec=info.utc.sec; 00022 00023 time_t seconds = mktime(&t); 00024 set_time(seconds); 00025 00026 SetTimeOk = 1; // RTC was set 00027 } 00028 } 00029 }
Generated on Thu Jul 14 2022 14:06:47 by
1.7.2