|
请教各位老板,温控器TC041C11W04是否有硬件RTC功能,在阅读代码的时候发现程序是用软件做的RTC定时,此函数每1秒调用一次,先将RTC_Set的值读一下再将RTC_Set的值写一下,十分不解,若没有硬件rtc功能,以下函数是没啥用的吧?
void Time_Calibration(void){ read_dgus_vp(RTC_Set,(u8*)time_calibra,4); if((time_calibra[0]==0x5A)&&(time_calibra[1]==0xA5)) { real_time.year=time_calibra[2]; real_time.month=time_calibra[3]; real_time.day=time_calibra[4]; real_time.hour=time_calibra[5]; real_time.min=time_calibra[6]; real_time.sec=time_calibra[7]; write_dgus_vp(RTC,(u8*)&real_time.year,4); time_calibra[0]=0; time_calibra[1]=0; write_dgus_vp(RTC_Set,(u8*)time_calibra,4); }}
|
|