mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 21:18:13 +08:00
(*) -> ()
This commit is contained in:
@@ -6,19 +6,19 @@
|
||||
#include "user_sntp.h"
|
||||
|
||||
/* Callback function when MiCO UTC time in sync to NTP server */
|
||||
static void sntp_time_call_back( void )
|
||||
static void sntp_time_call_back(void)
|
||||
{
|
||||
struct tm * currentTime;
|
||||
// iso8601_time_t iso8601_time;
|
||||
mico_utc_time_t utc_time;
|
||||
mico_rtc_time_t rtc_time;
|
||||
|
||||
// mico_time_get_iso8601_time( &iso8601_time );
|
||||
// mico_time_get_iso8601_time(&iso8601_time);
|
||||
// os_log("sntp_time_synced: %.26s", (char*)&iso8601_time);
|
||||
|
||||
mico_time_get_utc_time( &utc_time );
|
||||
mico_time_get_utc_time(&utc_time);
|
||||
utc_time+=28800; //+8:00
|
||||
currentTime = localtime( (const time_t *)&utc_time );
|
||||
currentTime = localtime((const time_t *)&utc_time);
|
||||
rtc_time.sec = currentTime->tm_sec;
|
||||
rtc_time.min = currentTime->tm_min;
|
||||
rtc_time.hr = currentTime->tm_hour;
|
||||
@@ -28,7 +28,7 @@ static void sntp_time_call_back( void )
|
||||
rtc_time.month = currentTime->tm_mon + 1;
|
||||
rtc_time.year = (currentTime->tm_year + 1900) % 100;
|
||||
|
||||
MicoRtcSetTime( &rtc_time );
|
||||
MicoRtcSetTime(&rtc_time);
|
||||
|
||||
|
||||
MicoRtcGetTime(&rtc_time);
|
||||
|
||||
Reference in New Issue
Block a user