From f5c08a0035d6e6207d00196a25468f2b947a4bdc Mon Sep 17 00:00:00 2001 From: Hayley Date: Fri, 28 Jun 2019 09:40:24 -0500 Subject: [PATCH] Added RTS/CTS flow control per FTDI representative reccommendation This does not fix the issue yet, however, the FTDI guy said we have to have this typw of flow control at this speed --- DSP_API/ThumbDV/thumbDV.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DSP_API/ThumbDV/thumbDV.c b/DSP_API/ThumbDV/thumbDV.c index 5e70220..d66cf94 100644 --- a/DSP_API/ThumbDV/thumbDV.c +++ b/DSP_API/ThumbDV/thumbDV.c @@ -292,12 +292,14 @@ static int thumbDV_writeSerial( FT_HANDLE handle , unsigned char * buffer, uint3 if ( handle != NULL ) { + FT_SetRts(handle); status = FT_Write(handle, buffer, bytes, &written); if ( status != FT_OK || written != bytes ) { output( ANSI_RED "Could not write to serial port. status = %d\n", status ); return status; } + FT_ClrRts(handle); } else { @@ -341,7 +343,7 @@ FT_HANDLE thumbDV_openSerial( FT_DEVICE_LIST_INFO_NODE device ) FT_STATUS status = FT_OK; UCHAR latency = 5; - output("Trying to open serial port %s /n", device.SerialNumber); + output("Trying to open serial port %s \n", device.SerialNumber); status = FT_OpenEx(device.SerialNumber, FT_OPEN_BY_SERIAL_NUMBER, &handle); @@ -360,9 +362,8 @@ FT_HANDLE thumbDV_openSerial( FT_DEVICE_LIST_INFO_NODE device ) // Set read and write timeout to 2seconds */ FT_SetTimeouts(handle, 0, 0); - FT_SetDataCharacteristics(handle, FT_BITS_8, FT_STOP_BITS_1, FT_PARITY_NONE); - FT_SetFlowControl(handle, FT_FLOW_XON_XOFF, 0x11, 0x13); + FT_SetFlowControl(handle, FT_FLOW_RTS_CTS, 0, 0); /* tty.c_cflag = ( tty.c_cflag & ~CSIZE ) | CS8;