??? check the diff, sorry ???
This commit is contained in:
@@ -184,6 +184,7 @@ static int keypad_test_mode = 0;
|
|||||||
typedef struct p {
|
typedef struct p {
|
||||||
int def[9];
|
int def[9];
|
||||||
int use[9];
|
int use[9];
|
||||||
|
int circular;
|
||||||
/*
|
/*
|
||||||
int type;
|
int type;
|
||||||
int port;
|
int port;
|
||||||
@@ -342,6 +343,7 @@ MtxOrb_init (Driver *drvthis, char *args)
|
|||||||
|
|
||||||
memset( p->def, -1, sizeof(p->def) );
|
memset( p->def, -1, sizeof(p->def) );
|
||||||
memset( p->use, 0, sizeof(p->use) );
|
memset( p->use, 0, sizeof(p->use) );
|
||||||
|
p->circular = -1;
|
||||||
|
|
||||||
|
|
||||||
MtxOrb_type = MTXORB_LKD; /* Assume it's an LCD w/keypad */
|
MtxOrb_type = MTXORB_LKD; /* Assume it's an LCD w/keypad */
|
||||||
@@ -1255,7 +1257,7 @@ MtxOrb_ask_bar (Driver *drvthis, int type)
|
|||||||
int pos;
|
int pos;
|
||||||
int last_not_in_use;
|
int last_not_in_use;
|
||||||
|
|
||||||
static int circular = -1;
|
/* static int circular = -1; Moved to PrivateData */
|
||||||
|
|
||||||
PrivateData * p = drvthis->private_data;
|
PrivateData * p = drvthis->private_data;
|
||||||
|
|
||||||
@@ -1280,11 +1282,11 @@ MtxOrb_ask_bar (Driver *drvthis, int type)
|
|||||||
if (pos == 8) {
|
if (pos == 8) {
|
||||||
last_not_in_use = 8; /* No empty slot to reuse. */
|
last_not_in_use = 8; /* No empty slot to reuse. */
|
||||||
/* fprintf(stderr, "GLU: MtxOrb_ask_bar| not found.\n"); */
|
/* fprintf(stderr, "GLU: MtxOrb_ask_bar| not found.\n"); */
|
||||||
circular = (circular + 1) % 8;
|
p->circular = (p->circular + 1) % 8;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (!p->use[(i + circular) % 8])
|
if (!p->use[(i + p->circular) % 8])
|
||||||
last_not_in_use = (i + circular) % 8;
|
last_not_in_use = (i + p->circular) % 8;
|
||||||
}
|
}
|
||||||
pos = last_not_in_use;
|
pos = last_not_in_use;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user