阅读:2535回复:1
wince触摸屏驱动和电池驱动冲突的问题下面是我做的更改,各位看看那儿出问题了,帮忙分析一下,谢谢先 触摸屏修改 1,在s3c2440a_touch.cpp里定义HANDLE hMutex; 2,在DdsiTouchPanelEnable里hMutex=CreateMutex(NULL,FALSE,TEXT("AClinkOfMutexObject")); 3,TSP_GetXY(INT *px, INT *py) //修改 { INT i; INT xsum, ysum; INT x, y; INT dx, dy; xsum = ysum = 0; for (i = 0; i < TSP_SAMPLE_NUM; i++) { if(hMutex ) { //RETAILMSG(1, (TEXT("Before ADC sample\r\n"))); WaitForSingleObject(hMutex, 5000); //RETAILMSG(1, (TEXT("after ADC sample\r\n"))); } //LockBattery(); v_pADCregs->ADCTSC = (0<<8)|(1<<7)|(1<<6)|(0<<5)|(1<<4)|(1<<3)|(1<<2)|(0); v_pADCregs->ADCCON |= (1 << 0); /* Start Auto conversion */ while (v_pADCregs->ADCCON & 0x1); /* check if Enable_start is low */ while (!(v_pADCregs->ADCCON & (1 << 15))); /* Check ECFLG */ x = (0x3ff & v_pADCregs->ADCDAT1); y = 0x3ff - (0x3ff & v_pADCregs->ADCDAT0); xsum += x; ysum += y; //UnlockBattery(); if(hMutex ) { ReleaseMutex(hMutex); } } *px = xsum / TSP_SAMPLE_NUM; *py = ysum / TSP_SAMPLE_NUM; v_pADCregs->ADCTSC = (1<<8)|(1<<7)|(1<<6)|(0<<5)|(1<< 4)|(0<<3)|(0<<2)|(3); dx = (*px > x) ? (*px - x) : (x - *px); dy = (*py > y) ? (*py - y) : (y - *py); return ((dx > TSP_INVALIDLIMIT || dy > TSP_INVALIDLIMIT) ? FALSE : TRUE); } 目前情况是触摸屏不能用了,而且调试口总是输出 Data Abort: Thread=83c69000 Proc=82126340 'device.exe' AKY=00000005 PC=02ca137c(battdrvr.dll+0x0000137c) RA=02ca1370(battdrvr.dll+0x000 01370) BVA=06000002 FSR=00000003 各位看看什么原因 帮忙分析一下 |
|
沙发#
发布于:2010-08-30 17:13
老兄,我也遇到这个问题了,你是怎么解决的啊,谢谢!
|
|