RTC_GetTime 讀出來的時間都是0 怎么回事?

RTC_GetTime 讀出來的時間都是0 怎么回事?

指針變量需要指向?qū)嶋H變量的地址,否則請傳入真實的變量地址:

你可以這樣:

????????//PUINT16?year,month,day,hour,m,sec;
????????uint16_t?year,month,day,hour,m,sec;
????????RTC_GetTime(&year,&month,&day,&hour,&m,&sec);
????????PRINT("========%04d-%02d-%02d?%02d:%02d:%02d=========\r\n",year,month,day,hour,m,sec);

或者這樣:

????????uint16_t?year1,month1,day1,hour1,m1,sec1;
????????PUINT16?year,month,day,hour,m,sec;
????????year?=?&year1;
????????month?=?&month1;
????????day?=?&day1;
????????hour?=?&hour1;
????????m?=?&m1;
????????sec?=?&sec1;
????????//uint16_t?year,month,day,hour,m,sec;
????????RTC_GetTime(year,month,day,hour,m,sec);
????????PRINT("========%04d-%02d-%02d?%02d:%02d:%02d=========\r\n",*year,*month,*day,*hour,*m,*sec);



只有登錄才能回復,可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频