diff --git a/src/libavrdude.h b/src/libavrdude.h index c53cf429..3411c1b8 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -1564,6 +1564,9 @@ typedef struct { // Static variable from config_gram.y int cfgy_pin_name; // Temporary variable for grammar parsing + + // Static variable from ppi.c + unsigned char ppi_shadow[3]; } cx_t; extern cx_t *cx; diff --git a/src/ppi.c b/src/ppi.c index ef2c9ef9..e883553f 100644 --- a/src/ppi.c +++ b/src/ppi.c @@ -54,7 +54,6 @@ enum { static int ppi_shadow_access(const union filedescriptor *fdp, int reg, unsigned char *v, unsigned char action) { - static unsigned char shadow[3]; int shadow_num; switch (reg) { @@ -75,14 +74,14 @@ static int ppi_shadow_access(const union filedescriptor *fdp, int reg, switch (action) { case PPI_SHADOWREAD: - *v = shadow[shadow_num]; + *v = cx->ppi_shadow[shadow_num]; break; case PPI_READ: DO_PPI_READ(fdp->ifd, reg, v); - shadow[shadow_num]=*v; + cx->ppi_shadow[shadow_num]=*v; break; case PPI_WRITE: - shadow[shadow_num]=*v; + cx->ppi_shadow[shadow_num]=*v; DO_PPI_WRITE(fdp->ifd, reg, v); break; }