|
发表于 2006-10-25 11:17:00
|
显示全部楼层
在以下函数中
kal_bool touch_panel_adc_to_coordinate(kal_int16 *x, kal_int16 *y)
{
*x=(kal_int16)(TPCali.x_slope*(double)(*x)+TPCali.x_offset);
*y=(kal_int16)(TPCali.y_slope*(double)(*y)+TPCali.y_offset);
if( (SCREEN_X_START<=*x)&&(*x<=SCREEN_X_END)&&
(SCREEN_Y_START<=*y)&&(*y<=SCREEN_Y_END))
{
// dbg_printWithTime("Valid X=%d Y=%d\r\n",*x,*y);
return KAL_TRUE;
}
else
{
//dbg_printWithTime("Invalid X=%d Y=%d\r\n",*x,*y);
if(*x<SCREEN_X_START)
*x=SCREEN_X_START;
else if (*x>SCREEN_X_END)
*x=SCREEN_X_END;
if(*y<SCREEN_Y_START)
*y=SCREEN_Y_START;
else if (*y>SCREEN_Y_END)
*y=SCREEN_Y_END;
return KAL_FALSE; //一定要以FALSE返回的,可以将毛刺过滤掉,具体原理就不多说了. 哈 哈哈哈
}
}[br]<p align=right><font color=red>+1 RD币</font></p> |
|