Uniquely name static globals
This commit is contained in:
parent
236622ffa6
commit
4bdd0ac697
|
@ -14,8 +14,8 @@ typedef struct
|
||||||
} overlayled_t;
|
} overlayled_t;
|
||||||
|
|
||||||
/* TODO/FIXME - static globals */
|
/* TODO/FIXME - static globals */
|
||||||
static overlayled_t curins;
|
static overlayled_t ledoverlay_curins;
|
||||||
static overlayled_t *cur = &curins;
|
static overlayled_t *ledoverlay_cur = &ledoverlay_curins;
|
||||||
|
|
||||||
static void overlay_init(void)
|
static void overlay_init(void)
|
||||||
{
|
{
|
||||||
|
@ -24,11 +24,11 @@ static void overlay_init(void)
|
||||||
|
|
||||||
for (i = 0; i < MAX_LEDS; i++)
|
for (i = 0; i < MAX_LEDS; i++)
|
||||||
{
|
{
|
||||||
cur->setup[i] = 0;
|
ledoverlay_cur->setup[i] = 0;
|
||||||
cur->map[i] = settings->uints.led_map[i];
|
ledoverlay_cur->map[i] = settings->uints.led_map[i];
|
||||||
|
|
||||||
if (cur->map[i] >= 0)
|
if (ledoverlay_cur->map[i] >= 0)
|
||||||
input_overlay_set_visibility(cur->map[i],
|
input_overlay_set_visibility(ledoverlay_cur->map[i],
|
||||||
OVERLAY_VISIBILITY_HIDDEN);
|
OVERLAY_VISIBILITY_HIDDEN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ static void overlay_set(int led, int state)
|
||||||
if ((led < 0) || (led >= MAX_LEDS))
|
if ((led < 0) || (led >= MAX_LEDS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gpio = cur->map[led];
|
gpio = ledoverlay_cur->map[led];
|
||||||
|
|
||||||
if (gpio < 0)
|
if (gpio < 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -26,8 +26,8 @@ typedef struct
|
||||||
} rpiled_t;
|
} rpiled_t;
|
||||||
|
|
||||||
/* TODO/FIXME - static globals */
|
/* TODO/FIXME - static globals */
|
||||||
static rpiled_t curins;
|
static rpiled_t rpi_curins;
|
||||||
static rpiled_t *cur = &curins;
|
static rpiled_t *rpi_cur = &rpi_curins;
|
||||||
|
|
||||||
static void rpi_init(void)
|
static void rpi_init(void)
|
||||||
{
|
{
|
||||||
|
@ -39,8 +39,8 @@ static void rpi_init(void)
|
||||||
|
|
||||||
for (i = 0; i < MAX_LEDS; i++)
|
for (i = 0; i < MAX_LEDS; i++)
|
||||||
{
|
{
|
||||||
cur->setup[i] = 0;
|
rpi_cur->setup[i] = 0;
|
||||||
cur->map[i] = settings->uints.led_map[i];
|
rpi_cur->map[i] = settings->uints.led_map[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,13 +104,13 @@ static void rpi_set(int led, int state)
|
||||||
if((led < 0) || (led >= MAX_LEDS))
|
if((led < 0) || (led >= MAX_LEDS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gpio = cur->map[led];
|
gpio = rpi_cur->map[led];
|
||||||
if(gpio <= 0)
|
if(gpio <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(cur->setup[led] == 0)
|
if(rpi_cur->setup[led] == 0)
|
||||||
cur->setup[led] = setup_gpio(gpio);
|
rpi_cur->setup[led] = setup_gpio(gpio);
|
||||||
if(cur->setup[led] > 0)
|
if(rpi_cur->setup[led] > 0)
|
||||||
set_gpio(gpio, state);
|
set_gpio(gpio, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,8 @@ typedef struct
|
||||||
} keyboard_led_t;
|
} keyboard_led_t;
|
||||||
|
|
||||||
/* TODO/FIXME - static globals */
|
/* TODO/FIXME - static globals */
|
||||||
static keyboard_led_t curins;
|
static keyboard_led_t win32kb_curins;
|
||||||
static keyboard_led_t *cur = &curins;
|
static keyboard_led_t *win32kb_cur = &win32kb_curins;
|
||||||
|
|
||||||
static void keyboard_init(void)
|
static void keyboard_init(void)
|
||||||
{
|
{
|
||||||
|
@ -80,21 +80,21 @@ static void keyboard_init(void)
|
||||||
|
|
||||||
for (i = 0; i < MAX_LEDS; i++)
|
for (i = 0; i < MAX_LEDS; i++)
|
||||||
{
|
{
|
||||||
cur->setup[i] = -1;
|
win32kb_cur->setup[i] = -1;
|
||||||
cur->map[i] = settings->uints.led_map[i];
|
win32kb_cur->map[i] = settings->uints.led_map[i];
|
||||||
if (cur->map[i] < 0)
|
if (win32kb_cur->map[i] < 0)
|
||||||
cur->map[i] = i;
|
win32kb_cur->map[i] = i;
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
cur->setup[i] = led_get(RETROK_NUMLOCK);
|
win32kb_cur->setup[i] = led_get(RETROK_NUMLOCK);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
cur->setup[i] = led_get(RETROK_CAPSLOCK);
|
win32kb_cur->setup[i] = led_get(RETROK_CAPSLOCK);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
cur->setup[i] = led_get(RETROK_SCROLLOCK);
|
win32kb_cur->setup[i] = led_get(RETROK_SCROLLOCK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,23 +106,23 @@ static void keyboard_free(void)
|
||||||
|
|
||||||
for (i = 0; i < MAX_LEDS; i++)
|
for (i = 0; i < MAX_LEDS; i++)
|
||||||
{
|
{
|
||||||
if (cur->setup[i] < 0)
|
if (win32kb_cur->setup[i] < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
led_set(RETROK_NUMLOCK, cur->setup[i]);
|
led_set(RETROK_NUMLOCK, win32kb_cur->setup[i]);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
led_set(RETROK_CAPSLOCK, cur->setup[i]);
|
led_set(RETROK_CAPSLOCK, win32kb_cur->setup[i]);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
led_set(RETROK_SCROLLOCK, cur->setup[i]);
|
led_set(RETROK_SCROLLOCK, win32kb_cur->setup[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cur->setup[i] = -1;
|
win32kb_cur->setup[i] = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ static void keyboard_set(int led, int state)
|
||||||
if ((led < 0) || (led >= MAX_LEDS))
|
if ((led < 0) || (led >= MAX_LEDS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (cur->map[led])
|
switch (win32kb_cur->map[led])
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
led_set(RETROK_NUMLOCK, state);
|
led_set(RETROK_NUMLOCK, state);
|
||||||
|
|
Loading…
Reference in New Issue