|
使用I2C.dll时的问题:
定义:
UCHAR S_Buf={0x49,
0x01,
0x08,
0xC0,
0x33,
0x00,
0x00,
0xE9,
0x0B,
0xb8,
0x01,
0x80,
0x47,
0x40,
0x00,
0x01,
0x2A,
0x00,
0x0c,
0xB7,
0x80,};
加载I2C.dll OK creatfile OK
做到这一步时:
bRet = WriteFile(hI2CDrv, S_Buf, sizeof(S_Buf), &dwbyte,NULL);
PB:
出对话框:First-chance exception in CXPORT.DLL
(0xC000001D:Illegal Instruction)
179229 PID:4df74722 TID:cdef14d6 0x8dee1adc: Exception 180 Thread=8dee1adc Proc=4df74722 'device.exe'
179229 PID:4df74722 TID:cdef14d6 0x8dee1adc: AKY=00000009 PC=03bb52fc(cxport.dll+0x000052fc) RA=03bb52fc(cxport.dll+0x000052fc) TEA=03bb52fc
要求打开 private\winceos\comm\cxport.c
可是没有这个文件,只有cxport.dll cxport.h,无法打开
不知cxport.c中那里出错 ?
同时EVC: 出错,要求退出。
对应
DWORD
I2C_Write(
DWORD dwData,
LPCVOID pBuf,
DWORD dwLen
)
{
PI2C_OPEN_INFO pOpen = (PI2C_OPEN_INFO)dwData;
DWORD WriteLength = 0;
EnterCriticalSection( &(pOpen -> pI2CHandle -> csI2C) );
WriteLength = I2C_MasterWrite(pOpen, pBuf, dwLen);
LeaveCriticalSection( &(pOpen -> pI2CHandle -> csI2C) );
return WriteLength;
}
|
|