From 4c71539cf14a1ca9353af7c96a75baea36c43483 Mon Sep 17 00:00:00 2001 From: Rene Liebscher Date: Sun, 5 Feb 2012 19:58:59 +0000 Subject: [PATCH] bug #30559 Ft232 bit-bang support * ft245r.c: cancel reader thread before exiting program git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@1066 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avrdude/ChangeLog | 5 +++++ avrdude/ft245r.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index 6f56a3c4..3bdd50c5 100644 --- a/avrdude/ChangeLog +++ b/avrdude/ChangeLog @@ -1,3 +1,8 @@ +2012-02-05 Rene Liebscher + + bug #30559 Ft232 bit-bang support + * ft245r.c: cancel reader thread before exiting program + 2012-02-04 Rene Liebscher patch #7717 avrftdi_flash_write is broken diff --git a/avrdude/ft245r.c b/avrdude/ft245r.c index 10e7ad5f..01222d10 100644 --- a/avrdude/ft245r.c +++ b/avrdude/ft245r.c @@ -526,6 +526,8 @@ static void ft245r_close(PROGRAMMER * pgm) { // I think the switch to BB mode and back flushes the buffer. ftdi_set_bitmode(handle, 0, BITMODE_SYNCBB); // set Synchronous BitBang, all in puts ftdi_set_bitmode(handle, 0, BITMODE_RESET); // disable Synchronous BitBang + pthread_cancel(readerthread); + pthread_join(readerthread, NULL); ftdi_usb_close(handle); ftdi_deinit (handle); free(handle);