Closed McApe closed 11 years ago
thank you for reporting this issue, it has been assigned.
The issue "bResultDataWrite is never changed thus TE_USB_FX2_SetData_InstanceDriverBuffer does always return ST_ERROR" has been fixed.
TE_USB_FX2_CYAPI int TE_USB_FX2_SetData_InstanceDriverBuffer (CCyUSBDevice USBdevList, CCyBulkEndPoint _BulkOutEP, PI_PipeNumber PipeNo,unsigned long Timeout, int BufferSize)
{
bool bResultDataWrite = false;
....//Search the EndPoint EP8 OUTPUT for Write Fpga Ram transmission from host computer to USB FX2 device
for (int i=1; i<eptCount; i++)
{
bool bOutR = ((USBdevList->EndPoints[i]->Address )==PipeNoHex);
bool bBulkR = (USBdevList->EndPoints[i]->Attributes == 2);
/_If the EndPoint EP8 OUTPUT exists instantiate the abstract class in the concrete class CCyBulkEndPoint,
set the TimeOut to Timeout, set the XferMode to XMODEDIRECT,use synchronous method XferData to transmit a packet of DeviceDriverBufferSize/
if (bBulkR && bOutR)
{
(BulkOutEP) = (CCyBulkEndPoint ) USBdevList->EndPoints[i];
(_BulkOutEP)->TimeOut=Timeout;
(_BulkOutEP)->XferMode=XMODE_DIRECT;
(_BulkOutEP)->SetXferSize(DeviceDriverBufferSize);
bResultDataWrite = true; // CORRECTION
}
}
...
if (bResultDataWrite)
return ST_OK;
else
return ST_ERROR;
}
bResultDataWrite is never changed thus TE_USB_FX2_SetData_InstanceDriverBuffer does always return ST_ERROR.
TE_USB_FX2_CYAPI int TE_USB_FX2_SetData_InstanceDriverBuffer (CCyUSBDevice _USBdevList, CCyBulkEndPoint *_BulkOutEP, PI_PipeNumber PipeNo,unsigned long Timeout, int BufferSize) { bool bResultDataWrite = false; .... if (bResultDataWrite) return ST_OK; else return ST_ERROR; }