RT,应用例程
ERRCODE DrvRTC_Open (S_DRVRTC_TIME_DATA_T *sPt)函数末尾死了,
.
.
outp32(DWR, (UINT32)sPt->u32cDayOfWeek);
g_u32hiYear = (sPt->u32Year - DRVRTC_YEAR2000) / 10;
g_u32loYear = (sPt->u32Year - DRVRTC_YEAR2000) % 10;
g_u32hiMonth = sPt->u32cMonth / 10;
g_u32loMonth = sPt->u32cMonth % 10;
g_u32hiDay = sPt->u32cDay / 10;
g_u32loDay = sPt->u32cDay % 10;
u32Reg = (g_u32hiYear << 20);
u32Reg |= (g_u32loYear << 16);
u32Reg |= (g_u32hiMonth << 12);
u32Reg |= (g_u32loMonth << 8);
u32Reg |= (g_u32hiDay << 4);
u32Reg |= g_u32loDay;
g_u32Reg = u32Reg;
outp32 (CLR, (UINT32)g_u32Reg);
g_u32hiHour = sPt->u32cHour / 10;
g_u32loHour = sPt->u32cHour % 10;
g_u32hiMin = sPt->u32cMinute / 10;
g_u32loMin = sPt->u32cMinute % 10;
g_u32hiSec = sPt->u32cSecond / 10;
g_u32loSec = sPt->u32cSecond % 10;
u32Reg = (g_u32hiHour << 20);
u32Reg |= (g_u32loHour << 16);
u32Reg |= (g_u32hiMin << 12);
u32Reg |= (g_u32loMin << 8);
u32Reg |= (g_u32hiSec << 4);
u32Reg |= g_u32loSec;
g_u32Reg = u32Reg;
outp32(TLR, (UINT32)g_u32Reg);
u32Reg = inp32(TLR);
while(u32Reg != (UINT32)g_u32Reg);//在这一句
我在OPEN前已经运行过CloseRTC函数。感觉像没有关成功RTC,
想问一下这还有那个没设置好?
|