Browse Source

nxphlite-v3:Use LED D9 and D10, remove RGB LEDs (going to PWM)

sbg
David Sidrane 7 years ago
parent
commit
9c7fd0ab9c
  1. 20
      src/drivers/boards/nxphlite-v3/nxphlite_led.c

20
src/drivers/boards/nxphlite-v3/nxphlite_led.c

@ -63,17 +63,19 @@ __END_DECLS @@ -63,17 +63,19 @@ __END_DECLS
static uint32_t g_ledmap[] = {
GPIO_LED_B, // Indexed by LED_BLUE
GPIO_LED_R, // Indexed by LED_RED, LED_AMBER
GPIO_LED_D9, // Indexed by LED_BLUE
GPIO_LED_D10, // Indexed by LED_RED, LED_AMBER
GPIO_LED_SAFETY, // Indexed by LED_SAFETY
GPIO_LED_G, // Indexed by LED_GREEN
0, // Indexed by LED_GREEN
};
__EXPORT void led_init(void)
{
/* Configure LED GPIOs for output */
for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) {
kinetis_pinconfig(g_ledmap[l]);
if (g_ledmap[l] != 0) {
kinetis_pinconfig(g_ledmap[l]);
}
}
}
@ -81,13 +83,19 @@ static void phy_set_led(int led, bool state) @@ -81,13 +83,19 @@ static void phy_set_led(int led, bool state)
{
/* Drive High to switch on */
kinetis_gpiowrite(g_ledmap[led], state);
if (g_ledmap[led] != 0) {
kinetis_gpiowrite(g_ledmap[led], state);
}
}
static bool phy_get_led(int led)
{
return kinetis_gpioread(g_ledmap[led]);
if (g_ledmap[led] != 0) {
return kinetis_gpioread(g_ledmap[led]);
}
return false;
}
__EXPORT void led_on(int led)

Loading…
Cancel
Save