初级会员

- 积分
- 140
- 金钱
- 140
- 注册时间
- 2015-12-4
- 在线时间
- 10 小时
|
我的4.3寸触摸屏按照教程一步一步进行移植的,为何在测试如下函数时,可以显示字符,但点击屏幕时,不会有任何反应?这是为何呢?(以下是从segger官网下载来的测试程序),
实在是找不出其他的原因了,所以希望各位大神给点思路...
void MainTask(void) {
GUI_PID_STATE TouchState;
int xPhys;
int yPhys;
GUI_Init();
// // Check if recommended memory for the sample is available //
if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
GUI_ErrorOut("Not enough memory available.");
return;
}
GUI_CURSOR_Show();
GUI_CURSOR_Select(&GUI_CursorCrossL);
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_Clear();
GUI_DispString("Measurement of\nA/D converter values");
while (1) {
GUI_TOUCH_GetState(&TouchState); // Get the touch position in pixel
xPhys = GUI_TOUCH_GetxPhys(); // Get the A/D mesurement result in x
yPhys = GUI_TOUCH_GetyPhys(); // Get the A/D mesurement result in y //
// Display the measurement result //
GUI_SetColor(GUI_BLUE);
GUI_DispStringAt("Analog input:\n", 0, 20);
GUI_GotoY(GUI_GetDispPosY() + 2);
GUI_DispString("x:");
GUI_DispDec(xPhys, 4);
GUI_DispString(", y:");
GUI_DispDec(yPhys, 4); // // Display the according position //
GUI_SetColor(GUI_RED);
GUI_GotoY(GUI_GetDispPosY() + 4);
GUI_DispString("\nPosition:\n");
GUI_GotoY(GUI_GetDispPosY() + 2);
GUI_DispString("x:");
GUI_DispDec(TouchState.x,4);
GUI_DispString(", y:");
GUI_DispDec(TouchState.y,4); // // Wait a while //
GUI_Delay(100);
};
}
|
|