ucos II+ucGUI+s3c2410+LCD+触摸屏整合
OSMboxPend(TouchMbox, 0, err); /* Acquire semaphore to perform random numbers */
CONSOL_Printf(Got a message\n);
GUI_TOUCH_Exec();//
}
}
2) 如下修改函数 GUI_TOUCH_Exec():
void GUI_TOUCH_Exec(void) {
#ifndef WIN32
static U8 ReadState;
int x,y;
/* calculate Min / Max values */
if (xyMinMax[GUI_COORD_X].Min xyMinMax[GUI_COORD_X].Max) {
xMin = xyMinMax[GUI_COORD_X].Min;
xMax = xyMinMax[GUI_COORD_X].Max;
} else {
xMax = xyMinMax[GUI_COORD_X].Min;
xMin = xyMinMax[GUI_COORD_X].Max;
}
if (xyMinMax[GUI_COORD_Y].Min xyMinMax[GUI_COORD_Y].Max) {
yMin = xyMinMax[GUI_COORD_Y].Min;
yMax = xyMinMax[GUI_COORD_Y].Max;
} else {
yMax = xyMinMax[GUI_COORD_Y].Min;
yMin = xyMinMax[GUI_COORD_Y].Max;
}
/* Execute the state machine which reads the touch */
//switch (ReadState) {
//case 0:
yPhys = TOUCH_X_MeasureY();
// TOUCH_X_ActivateY(); /* Prepare X- measurement */
// ReadState++;
// break;
//default:
xPhys = TOUCH_X_MeasureX();
// TOUCH_X_ActivateX(); /* Prepare Y- measurement */
/* Convert values into logical values */
#if !GUI_TOUCH_SWAP_XY /* Is X/Y swapped ? */
x = xPhys;
y = yPhys;
#else
x = yPhys;
y = xPhys;
#endif
if ((x
GUI_TOUCH_StoreUnstable(-1,-1);
} else {
x = AD2X(x);
y = AD2Y(y);
GUI_TOUCH_StoreUnstable(x,y);
}
/* Reset state machine */
//ReadState=0;
// break;
//}
#endif /* WIN32 */
}
五、 GUI多任务测试:
测试程序:MT_MultiTasking.c
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)