mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-28 12:06:59 +03:00
Put static variable of ppi.c into context structure
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user