Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Dewesoft C++ DLL

Trenz Electronic C# DLL

void ResetFX2FifoStatus(HANDLE handle)
{

static void ResetFX2FifoStatus
(CyUSBDevice TE_USB_FX2_USBDevice)
{

 

if (TE_USB_FX2_USBDevice == null)
{
    Console.WriteLine("Error,no device is selected");
    return;
}

    cout << endl << "Resetting all FIFOs" << endl;    Console.WriteLine("Resetting all FIFOs");

    byte cmd[64], reply[64]; 
    int cmd_length = 64;
    int reply_length = 64;

    byte[] cmd = new byte[64];
    byte[] reply = new byte[64];
    int cmd_length = 64;
    int reply_length = 64;
     uint TIMEOUT_MS = 100;
    cmd[0] = 0xA4;//command RESET_FIFO_STATUS
    cmd[1] = 0;//RESET all FIFOs
    cmd[0] = (byte)FX2_Commands.RESET_FIFO_STATUS;
    cmd[1] = 0; //reset all fifos
    if (TE0300_SendCommand
(handle, cmd, cmd_length, reply,
&reply_length, 1000))  cout << "Error" << endl;
    if (TE_USB_FX2.TE_USB_FX2.TE_USB_FX2_SendCommand
(ref TE_USB_FX2_USBDevice, ref cmd, ref cmd_length, ref reply,
ref
reply_length, TIMEOUT_MS) == false
                   Console.WriteLine("Error Send Command Reset all fifos");
    cmd[0] = 0xA0;//command INITIALIZE
    cmd[1] = 1;//FIFO mode
    cmd[0] = (byte)FX2_Commands.INITALIZE; //0xA0;//command INITIALIZE
    cmd[1] = 1;//FIFO mode

    if (TE0300_SendCommand
(handle, cmd, cmd_length, reply,
&reply_length, 1000)) 
       cout << "Error" << endl;
}

    if (TE_USB_FX2.TE_USB_FX2.TE_USB_FX2_SendCommand
(ref TE_USB_FX2_USBDevice, ref cmd, ref cmd_length, ref reply,
ref reply_length, TIMEOUT_MS) == false
        Console.WriteLine("Error Switch Mode Fifo Mode");
}     

...