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
This commit is contained in:
Joerg Wunsch 2021-11-24 22:27:59 +00:00
parent 105cebb389
commit 5bf24e4e96
2 changed files with 9 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2021-11-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
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 <j.gnu@uriah.heep.sax.de> 2021-11-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
Submitted by David Mosberger-Tang: Submitted by David Mosberger-Tang:

View File

@ -151,7 +151,6 @@ static struct ftdi_context *handle;
static unsigned char ft245r_ddr; static unsigned char ft245r_ddr;
static unsigned char ft245r_out; static unsigned char ft245r_out;
static unsigned char ft245r_in;
#define BUFSIZE 0x2000 #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); ft245r_out = SET_BITS_0(ft245r_out,pgm,pinname,val);
buf[0] = ft245r_out; buf[0] = ft245r_out;
ft245r_send (pgm, buf, 1); ft245r_send_and_discard(pgm, buf, 1);
ft245r_recv (pgm, buf, 1);
ft245r_in = buf[0];
return 0; return 0;
} }
@ -880,8 +876,7 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) {
*/ */
ft245r_drain (pgm, 0); ft245r_drain (pgm, 0);
ft245r_send (pgm, &ft245r_out, 1); ft245r_send_and_discard(pgm, &ft245r_out, 1);
ft245r_recv (pgm, &ft245r_in, 1);
return 0; return 0;