NUC472的RTC时钟跳变比如说从5秒直接调到7秒,不经过6秒,程序如下:
main(void)
{
S_RTC_TIME_DATA_T sInitTime, sReadRTC;
SYS_Init();
UART0_Init();
/* Time Setting */
sInitTime.u32Year = 2013;
sInitTime.u32Month = 10;
sInitTime.u32Day = 15;
sInitTime.u32Hour = 12;
sInitTime.u32Minute = 30;
sInitTime.u32Second = 0;
sInitTime.u32DayOfWeek = RTC_TUESDAY;
sInitTime.u32TimeScale = RTC_CLOCK_24;
RTC_Open(&sInitTime);
printf("\n RTC Time Display Test (Exit after 5 seconds)\n\n");
while(1)
{
volatile unsigned int i;
for(i=0;i<=2000000;i++)
{;}
RTC_GetDateAndTime(&sReadRTC);
printf(" Current Time:%d/%02d/%02d %02d:%02d:%02d\n",sReadRTC.u32Year,sReadRTC.u32Month,sReadRTC.u32Day,sReadRTC.u32Hour,sReadRTC.u32Minute,sReadRTC.u32Second);
}
}
|