From a27c99376db5aac6556c58dcea7fea4174425a92 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Fri, 9 Oct 2020 21:17:04 +0200 Subject: [PATCH] ftdiJtagMPSSE: don't use MPSSE_DO_WRITE for read only transaction --- src/ftdiJtagMPSSE.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ftdiJtagMPSSE.cpp b/src/ftdiJtagMPSSE.cpp index f64dd5a..b42bc8b 100644 --- a/src/ftdiJtagMPSSE.cpp +++ b/src/ftdiJtagMPSSE.cpp @@ -212,8 +212,8 @@ int FtdiJtagMPSSE::writeTDI(uint8_t *tdi, uint8_t *tdo, uint32_t len, bool last) unsigned char c[len]; unsigned char *rx_ptr = (unsigned char *)tdo; unsigned char *tx_ptr = (unsigned char *)tdi; - unsigned char tx_buf[3] = {(unsigned char)(MPSSE_LSB | MPSSE_WRITE_NEG | - ((tdi) ? MPSSE_DO_WRITE : 0) | + unsigned char tx_buf[3] = {(unsigned char)(MPSSE_LSB | + ((tdi) ? (MPSSE_DO_WRITE | MPSSE_WRITE_NEG) : 0) | ((tdo) ? MPSSE_DO_READ : 0)), static_cast((xfer - 1) & 0xff), // low static_cast((((xfer - 1) >> 8) & 0xff))}; // high