Cypress技术论坛
直播中

侯倩

8年用户 204经验值
私信 关注
[问答]

再次插入时如何重新连接FX2LP设备?

嗨,我有一个CY1306A在我的董事会。我在Windows 10的C++(QT平台)中编码。我想抵制我的代码重新插入USB。
这是我的密码:
空主窗口::NeXyDATA(){//每40毫秒运行一个定时器tiG
CCyUSBDevice USBDevice;
短int nNoMuts= UBStuto.DeVICECONTUTE();
if(NoMuths==1){if(UbStudio.ISOPEN()){
长的长度=包装尺寸;
ISSOKO= UBStuto.BulkEndoPT & Gt;XFEDATA((PUCHAR)XFFABORPHION in [ 0 ],长度,(CySyopktIfn*)0,FALSE);
} }
但有时效果不错,有时会崩溃。

以上来自于百度翻译


     以下为原文
  hi, i have a CY1306A in my board. i am coding in C++(Qt platform) in windows 10. i want to resist my code on re-plugging u***.
this is my code:
void MainWindow::new_Data(){// run every 40 ms with a timer trig
CCyUSBDevice USBDevice;
short int numDevices = USBDevice.DeviceCount();
    if(numDevices==1){
             if(USBDevice.IsOpen()){
        LONG length = PACKET_SIZE;
        is_ok=USBDevice.BulkInEndPt->XferData((PUCHAR)xferBuffer_in[0], length , (CCyIsoPktInfo*)0,false);
      }
}
}
but sometime it works good and some times it crashes.  

回帖(2)

张超

2019-1-4 14:28:20
你好,
-设备是否使用CY7C68013A?
-我知道NeXyDATA()是否每40ms执行一次?
每次运行此函数时,您需要在长度为PACKETHEIZIN的XFEFBURIGIN中发送大量端点的数据,对吗?
当你说“崩溃”时,你的意思是XFelDATA()返回false还是应用程序崩溃?
当做,
血竭

以上来自于百度翻译


     以下为原文
  Hi,
 
- Is the device being used  CY7C68013A?
- I understand that new_Data() is being executed every 40mS right?
- Every time this function is run, you need to send data in xferBuffer_in of length PACKET_SIZE over the Bulk endpoint right?
- When you say "it crashes", do you mean the XferData() is returning false OR is the application crashes?
 
Regards,
Hemanth
举报

侯倩

2019-1-4 14:36:37
引用: xianhaizhe 发表于 2019-1-4 11:31
你好,
-设备是否使用CY7C68013A?
-我知道NeXyDATA()是否每40ms执行一次?

是的,设备是CY7C68013A,每40毫秒NeXyDATA()执行。我需要在散装端点上读取长度包大小的XFFabelErgin数据。崩溃意味着应用崩溃。
是否有可能在代码检查条件和等待接收数据时,USB断开和崩溃。对此有什么解决方案吗?

以上来自于百度翻译


     以下为原文
  yes, the device is CY7C68013A. and every 40 ms new_Data() is executed. i need to read data in xferBuffer_in of length PACKET_SIZE over the Bulk endpoint.
it crashes means application crashes.
is it possible that when the code check true the conditions and waiting for receive data, u*** disconnected and it crashes.is there  any solution for this?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分