没有人做过类似的开发吗?
目前我定位了程序卡死在刷新函数的FOR循环内部。但还没有找到原因。
void UpdateDisplay(void)
{
DevHandle hRS232Handle;
uchar *pucCurrentDispMem;
ushort datatemp;
uint j;
pucCurrentDispMem = EG_lcd_pucCurrentDispMem;
//输出串口调试信息
EA_ucOpenDevice("COM", EM_io_PORT1, &hRS232Handle);
EA_ucInitRS232(hRS232Handle, EM_232_115200BPS, EM_232_NOPAR, EM_232_8DBS);
EA_ucWriteDevice(hRS232Handle, 16, 1, "LCD Update set!\r\n");
SetWindows(0x0000,0x0000,0x00EF,0x013F);
SetCursor(0x0000,0x0000);
WRITE_INDEX(0x22);
for (j=0; j <76800; j++)
{
datatemp=((ushort)(*pucCurrentDispMem++)) + (((ushort)(*pucCurrentDispMem))<<8); //2个8bit--->16bit
pucCurrentDispMem++;
WRITE_DATA(datatemp);
EA_ucWriteDevice(hRS232Handle, 7, 1, "Update\r\n"); // 程序卡死在此位置
}
EA_ucWriteDevice(hRS232Handle, 16, 1, "LCD Update end!\r\n");
EA_ucCloseDevice(&hRS232Handle);
}
程序卡死在 for 循环从显示缓存把数据刷新到LCD屏的过程中,实验时发现下面这句的标红色字体部分如果长度不同,卡死的位置也有所差异。但程序一定卡死在这个for循环内部。
EA_ucWriteDevice(hRS232Handle, 7, 1, "???\r\n");
|