我的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(&quot;Not enough memory available.&quot;);
return;
}
GUI_CURSOR_Show();
GUI_CURSOR_Select(&GUI_CursorCrossL);
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_Clear();
GUI_DispString(&quot;Measurement of
A/D converter values&quot;);
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(&quot;Analog input:
&quot;, 0, 20);
GUI_GotoY(GUI_GetDispPosY() + 2);
GUI_DispString(&quot;x:&quot;);
GUI_DispDec(xPhys, 4);
GUI_DispString(&quot;, y:&quot;);
GUI_DispDec(yPhys, 4); // // Display the according position //
GUI_SetColor(GUI_RED);
GUI_GotoY(GUI_GetDispPosY() + 4);
GUI_DispString(&quot;
Position:
&quot;);
GUI_GotoY(GUI_GetDispPosY() + 2);
GUI_DispString(&quot;x:&quot;);
GUI_DispDec(TouchState.x,4);
GUI_DispString(&quot;, y:&quot;);
GUI_DispDec(TouchState.y,4); // // Wait a while //
GUI_Delay(100);
};
} |