patch #9757: Fix ATtiny817 Xplained Mini programmer
* jtag3.c (jtag3_getsync, jtag3_close): correctly extract programmer name from list of names git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1478 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
8004e38403
commit
bd50422644
|
@ -1,3 +1,9 @@
|
|||
2021-11-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #9757: Fix ATtiny817 Xplained Mini programmer
|
||||
* jtag3.c (jtag3_getsync, jtag3_close): correctly extract
|
||||
programmer name from list of names
|
||||
|
||||
2021-11-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by David Sainty:
|
||||
|
|
1
NEWS
1
NEWS
|
@ -112,6 +112,7 @@ Current:
|
|||
patch #9122: Fixed MISO sampling in ftdi_syncbb
|
||||
patch #9123: ftdi_syncbb: use FT245R_CYCLES in ft245r_set_bitclock()
|
||||
patch #8719: Support Over-the-Air bootloading with XBeeBoot
|
||||
patch #9757: Fix ATtiny817 Xplained Mini programmer
|
||||
|
||||
* Internals:
|
||||
- New avrdude.conf keyword "family_id", used to verify SIB attributes
|
||||
|
|
16
jtag3.c
16
jtag3.c
|
@ -30,6 +30,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -161,6 +162,11 @@ u16_to_b2(unsigned char *b, unsigned short l)
|
|||
b[1] = (l >> 8) & 0xff;
|
||||
}
|
||||
|
||||
static bool matches(const char *s, const char *pat)
|
||||
{
|
||||
return strncmp(s, pat, strlen(pat)) == 0;
|
||||
}
|
||||
|
||||
static void jtag3_print_data(unsigned char *b, size_t s)
|
||||
{
|
||||
int i;
|
||||
|
@ -866,12 +872,11 @@ int jtag3_getsync(PROGRAMMER * pgm, int mode) {
|
|||
|
||||
/* XplainedMini boards do not need this, and early revisions had a
|
||||
* firmware bug where they complained about it. */
|
||||
if (pgm->flag & PGM_FL_IS_EDBG) {
|
||||
if (strcmp(pgm->id, "xplainedmini_updi") != 0) {
|
||||
if ((pgm->flag & PGM_FL_IS_EDBG) &&
|
||||
!matches(ldata(lfirst(pgm->id)), "xplainedmini")) {
|
||||
if (jtag3_edbg_prepare(pgm) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the sign-on information. */
|
||||
|
@ -1629,10 +1634,9 @@ void jtag3_close(PROGRAMMER * pgm)
|
|||
|
||||
/* XplainedMini boards do not need this, and early revisions had a
|
||||
* firmware bug where they complained about it. */
|
||||
if (pgm->flag & PGM_FL_IS_EDBG) {
|
||||
if (strcmp(pgm->id, "xplainedmini_updi") != 0) {
|
||||
if ((pgm->flag & PGM_FL_IS_EDBG) &&
|
||||
!matches(ldata(lfirst(pgm->id)), "xplainedmini")) {
|
||||
jtag3_edbg_signoff(pgm);
|
||||
}
|
||||
}
|
||||
|
||||
serial_close(&pgm->fd);
|
||||
|
|
Loading…
Reference in New Issue