急救!求触摸屏测试程序
我的环境是s3c2410与linux. 我写的触摸屏的测试程序怎么总是读不出值。 小弟是菜鸟,请大虾们帮帮忙啊!!
。。。。。
typedef struct s3c2410_ts_event {
unsigned short pressure;
unsigned short x;
unsigned short y;
unsigned short pad;
} TS_EVENT;
main()
{
int file,count;
TS_EVENT ev;
file = open("/dev/touchsceen",O_RDONLY);
if (file == -1) {
printf("open device error!
");
return 0;
}
while(1)
{
count=read(file, &ev, sizeof(struct s3c2410_ts_event));
if (count==sizeof(struct s3c2410_ts_event))
printf("x= %d, y= %d, flag=0x%04x
", ev.x, ev.y, ev.pressure);
}
close(file);
return 0;
}