Utilise magic memory tree interface for buspirate.c

This commit is contained in:
Stefan Rueger
2024-04-19 12:48:24 +01:00
parent a942b31a98
commit 2ce7580977
2 changed files with 4 additions and 6 deletions

View File

@@ -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, ...);

View File

@@ -1115,16 +1115,13 @@ static int buspirate_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
}
/* Interface - management */
static void buspirate_setup(PROGRAMMER *pgm)
{
/* Allocate private data */
static void buspirate_setup(PROGRAMMER *pgm) {
pgm->cookie = mmt_malloc(sizeof(struct pdata));
PDATA(pgm)->serial_recv_timeout = 100;
}
static void buspirate_teardown(PROGRAMMER *pgm)
{
free(pgm->cookie);
static void buspirate_teardown(PROGRAMMER *pgm) {
mmt_free(pgm->cookie);
}
const char buspirate_desc[] = "Using the Bus Pirate's SPI interface for programming";