1.默认合法时间更改为2023到2050
This commit is contained in:
parent
a9d2466106
commit
49c47f0edc
|
@ -209,7 +209,7 @@ SINT32 sf_sys_rtc_time_check(SF_PARA_TIME_S *pstDateTime)
|
|||
{
|
||||
SF_COMM_CHECK_POINTER(pstDateTime,SF_FALSE);
|
||||
SLOGI("%d-%d-%d %d:%d:%d\n",pstDateTime->Year,pstDateTime->Mon,pstDateTime->Day,pstDateTime->Hour,pstDateTime->Min,pstDateTime->Sec);
|
||||
if((pstDateTime->Year >= 2021) && \
|
||||
if((pstDateTime->Year >= 2023) && \
|
||||
(pstDateTime->Year <= 2050) && \
|
||||
(pstDateTime->Mon <= 12) && \
|
||||
(pstDateTime->Day <= 31) && \
|
||||
|
@ -235,12 +235,13 @@ SINT32 sf_sys_rtc_time_reset(void)
|
|||
}
|
||||
|
||||
struct rtc_time rtctm;
|
||||
rtctm.tm_year = 2022 - 1900;
|
||||
rtctm.tm_mon = 0;
|
||||
rtctm.tm_year = 2023 - 1900;
|
||||
rtctm.tm_mon = 1;
|
||||
rtctm.tm_mday = 1;
|
||||
rtctm.tm_hour = 8;
|
||||
rtctm.tm_min = 0;
|
||||
rtctm.tm_sec = 0;
|
||||
SLOGI("%d-%d-%d %d:%d:%d\n",rtctm.tm_year+1900,rtctm.tm_mon,rtctm.tm_mday,rtctm.tm_hour,rtctm.tm_min,rtctm.tm_sec);
|
||||
|
||||
ret=ioctl(fdRtc,RTC_SET_TIME, &rtctm);
|
||||
if (ret < 0)
|
||||
|
@ -371,7 +372,7 @@ SINT32 sf_sys_rtoscmd_set(SINT8 cmd, SINT8 *para)
|
|||
if(SF_TRUE != sf_sys_rtc_time_check(&date))
|
||||
{
|
||||
ret = sf_sys_rtc_time_reset();
|
||||
date.Year = 2022;
|
||||
date.Year = 2023;
|
||||
date.Mon = 1;
|
||||
date.Day = 1;
|
||||
date.Hour = 8;
|
||||
|
|
Loading…
Reference in New Issue
Block a user