在打開設(shè)備后的具體調(diào)用代碼如下
????UCHAR?*?data?=?new?UCHAR[128];
????UCHAR?*?recv?=?new?UCHAR[128];
????ULONG?i?=?0,?send_len?=?3,?recv_len?=?6;
????data[0]?=?0x55;
????data[1]?=?0x07;
????data[2]?=?0xC2;
????qDebug()?<<?"發(fā)送數(shù)據(jù)\n";
????this->CH347I2C_Set_IM(this->DevIndex[this->ui->CBX_DeviceList->currentIndex()],?0x01);
????//if?(this->CH347StreamI2C_IM(this->DevIndex[this->ui->CBX_DeviceList->currentIndex()],?3,?data,?64,?recv))?{
????if?(this->CH347StreamI2C_IM(i,?send_len,?(PVOID)data,?recv_len,?(PVOID)recv))?{
????????qDebug()?<<?"recv:?"?<<?recv?<<?"\n";
????}?else?{
????????qDebug()?<<?"讀取失敗\n";
????}
????delete[]?data;
????delete[]?recv;
當(dāng)執(zhí)行到 CH347StreamI2C 函數(shù)后會導(dǎo)致程序異常崩潰,請問會是什么原因引起的?
熱門產(chǎn)品 :
CH641: PD及無線充電專用MCU