mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-28 20:09:12 +03:00
Utilise magic memory tree interface for wiring.c
This commit is contained in:
@@ -44,6 +44,7 @@ extern const char *pgmid; // Programmer -c string
|
||||
#define mmt_strdup(s) cfg_strdup(__func__, s)
|
||||
#define mmt_malloc(n) cfg_malloc(__func__, n)
|
||||
#define mmt_realloc(p, n) cfg_realloc(__func__, p, n)
|
||||
#define mmt_free(p) free(p)
|
||||
|
||||
int avrdude_message2(FILE *fp, int lno, const char *file, const char *func, int msgmode, int msglvl, const char *format, ...);
|
||||
|
||||
|
||||
@@ -69,11 +69,11 @@ static void wiring_setup(PROGRAMMER *pgm) {
|
||||
stk500v2_setup(pgm);
|
||||
|
||||
// Then prepare our data and store in a safe place for the time being
|
||||
((struct pdata *)(pgm->cookie))->chained_pdata = cfg_malloc(__func__, sizeof(struct wiringpdata));
|
||||
((struct pdata *)(pgm->cookie))->chained_pdata = mmt_malloc(sizeof(struct wiringpdata));
|
||||
}
|
||||
|
||||
static void wiring_teardown(PROGRAMMER *pgm) {
|
||||
free(((struct pdata *)(pgm->cookie))->chained_pdata);
|
||||
mmt_free(((struct pdata *)(pgm->cookie))->chained_pdata);
|
||||
stk500v2_teardown(pgm);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user