From 5bf24e4e96bc92d2692a15fc7df430957d0af328 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Wed, 24 Nov 2021 22:27:59 +0000 Subject: [PATCH] patch #9327: ft245r.c: add TPI support (patches 1-4) Submitted by David Mosberger-Tang: ft245r.c (set_pin, ft245r_open): use ft245r_send_and_discard() so ft245r_in can go away git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1486 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 7 +++++++ ft245r.c | 9 ++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9d215f3..fc32b863 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-11-24 Joerg Wunsch + + Submitted by David Mosberger-Tang: + patch #9327: ft245r.c: add TPI support (patches 1-4) + * ft245r.c (set_pin, ft245r_open): use + ft245r_send_and_discard() so ft245r_in can go away + 2021-11-24 Joerg Wunsch Submitted by David Mosberger-Tang: diff --git a/ft245r.c b/ft245r.c index c2bfb561..8a8d56a5 100644 --- a/ft245r.c +++ b/ft245r.c @@ -151,7 +151,6 @@ static struct ftdi_context *handle; static unsigned char ft245r_ddr; static unsigned char ft245r_out; -static unsigned char ft245r_in; #define BUFSIZE 0x2000 @@ -321,10 +320,7 @@ static int set_pin(PROGRAMMER * pgm, int pinname, int val) { ft245r_out = SET_BITS_0(ft245r_out,pgm,pinname,val); buf[0] = ft245r_out; - ft245r_send (pgm, buf, 1); - ft245r_recv (pgm, buf, 1); - - ft245r_in = buf[0]; + ft245r_send_and_discard(pgm, buf, 1); return 0; } @@ -880,8 +876,7 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) { */ ft245r_drain (pgm, 0); - ft245r_send (pgm, &ft245r_out, 1); - ft245r_recv (pgm, &ft245r_in, 1); + ft245r_send_and_discard(pgm, &ft245r_out, 1); return 0;