mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-10-09 04:01:01 +00:00
patch #7688: Implement parent programmers feature
* avrdude.conf.in: updated documentation comment and some programmers have now parents * config_gram.y: initpgm will now called at first use of programmer in main. parser sets only the function pointer in the pgm structure. Pin and pin lists definitions can now be empty to remove the parents setting. * doc/avrdude.texi: updated documentation * main.c: added call to pgm->initpgm after locate_programmer * pgm.[hc]: added field initpgm in structure, added function pgm_dup git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1045 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
20
pgm.c
20
pgm.c
@@ -82,6 +82,7 @@ PROGRAMMER * pgm_new(void)
|
||||
pgm->config_file[0] = 0;
|
||||
pgm->lineno = 0;
|
||||
pgm->baudrate = 0;
|
||||
pgm->initpgm = NULL;
|
||||
|
||||
for (i=0; i<N_PINS; i++)
|
||||
pgm->pinno[i] = 0;
|
||||
@@ -147,6 +148,25 @@ void pgm_free(PROGRAMMER * const p)
|
||||
free(p);
|
||||
}
|
||||
|
||||
PROGRAMMER * pgm_dup(const PROGRAMMER const * src)
|
||||
{
|
||||
PROGRAMMER * pgm;
|
||||
|
||||
pgm = (PROGRAMMER *)malloc(sizeof(*pgm));
|
||||
if (pgm == NULL) {
|
||||
fprintf(stderr, "%s: out of memory allocating programmer structure\n",
|
||||
progname);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memcpy(pgm, src, sizeof(*pgm));
|
||||
|
||||
pgm->id = lcreat(NULL, 0);
|
||||
|
||||
return pgm;
|
||||
}
|
||||
|
||||
|
||||
static void pgm_default(void)
|
||||
{
|
||||
fprintf(stderr, "%s: programmer operation not supported\n", progname);
|
||||
|
Reference in New Issue
Block a user