初中生
最后登录1970-1-1
在线时间 小时
注册时间2015-1-4
|
Tmp_YY等,为什么初始化为0xFF?
void Time_Regulate(struct rtc_time *tm)
{
u32 Tmp_YY = 0xFF, Tmp_MM = 0xFF, Tmp_DD = 0xFF, Tmp_HH = 0xFF, Tmp_MI = 0xFF, Tmp_SS = 0xFF;
printf("\r\n=========================Time Settings==================");
printf("\r\n ÇëêäèëÄê·Y(Please Set Years): 20");
while (Tmp_YY == 0xFF)
{
Tmp_YY = USART_Scanf(99);
}
printf("\n\r Äê·Y±»éèÖÃÎa: 20%0.2d\n\r", Tmp_YY);
tm->tm_year = Tmp_YY+2000;
Tmp_MM = 0xFF;
printf("\r\n ÇëêäèëÔ·Y(Please Set Months): ");
while (Tmp_MM == 0xFF)
{
Tmp_MM = USART_Scanf(12);
}
printf("\n\r Ô·Y±»éèÖÃÎa: %d\n\r", Tmp_MM);
tm->tm_mon= Tmp_MM;
Tmp_DD = 0xFF;
printf("\r\n ÇëêäèëèÕÆú(Please Set Dates): ");
while (Tmp_DD == 0xFF)
{
Tmp_DD = USART_Scanf(31);
}
printf("\n\r èÕÆú±»éèÖÃÎa: %d\n\r", Tmp_DD);
tm->tm_mday= Tmp_DD;
Tmp_HH = 0xFF;
printf("\r\n Çëêäèëê±Öó(Please Set Hours): ");
while (Tmp_HH == 0xFF)
{
Tmp_HH = USART_Scanf(23);
}
printf("\n\r ê±Öó±»éèÖÃÎa: %d\n\r", Tmp_HH );
tm->tm_hour= Tmp_HH;
Tmp_MI = 0xFF;
printf("\r\n Çëêäèë·ÖÖó(Please Set Minutes): ");
while (Tmp_MI == 0xFF)
{
Tmp_MI = USART_Scanf(59);
}
printf("\n\r ·ÖÖó±»éèÖÃÎa: %d\n\r", Tmp_MI);
tm->tm_min= Tmp_MI;
Tmp_SS = 0xFF;
printf("\r\n ÇëêäèëÃëÖó(Please Set Seconds): ");
while (Tmp_SS == 0xFF)
{
Tmp_SS = USART_Scanf(59);
}
printf("\n\r ÃëÖó±»éèÖÃÎa: %d\n\r", Tmp_SS);
tm->tm_sec= Tmp_SS;
}
|
|