LPC4357 EVB: Ooops got sense of the LED GPIO backward
This commit is contained in:
parent
8fa2d01ac3
commit
c5fa29a1aa
@ -555,7 +555,7 @@ LED and Pushbuttons
|
||||
LED SIGNAL MCU
|
||||
D6 LED_3V3 PE_& GPIO7[7]
|
||||
|
||||
LED is grounded and a high output illuminates the LED.
|
||||
A low output illuminates the LED.
|
||||
|
||||
If CONFIG_ARCH_LEDS is defined, the LED will be controlled as follows
|
||||
for NuttX debug functionality (where NC means "No Change").
|
||||
|
@ -207,7 +207,7 @@
|
||||
* D6 LED_3V3 PE_7 GPIO7[7]
|
||||
* ---- ------- -------------
|
||||
*
|
||||
* LED is grounded and a high output illuminates the LED.
|
||||
* A low output illuminates the LED.
|
||||
*
|
||||
* LED index values for use with lpc43_setled()
|
||||
*/
|
||||
|
@ -59,7 +59,7 @@
|
||||
* D6 LED_3V3 PE_7 GPIO7[7]
|
||||
* ---- ------- -------------
|
||||
*
|
||||
* LED is grounded and a high output illuminates the LED.
|
||||
* A low output illuminates the LED.
|
||||
*
|
||||
* Definitions to configure LED pins as GPIOs:
|
||||
*
|
||||
@ -72,7 +72,7 @@
|
||||
|
||||
/* Definitions to configure LED GPIO as outputs */
|
||||
|
||||
#define GPIO_LED (GPIO_MODE_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT7 | GPIO_PIN7)
|
||||
#define GPIO_LED (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT7 | GPIO_PIN7)
|
||||
|
||||
/* Button definitions *******************************************************/
|
||||
/* to be provided */
|
||||
|
@ -155,21 +155,26 @@ void board_led_initialize(void)
|
||||
|
||||
void board_led_on(int led)
|
||||
{
|
||||
bool ledon = true; /* OFF. Low illuminates */
|
||||
|
||||
switch (led)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
lpc43_gpio_write(GPIO_LED, false); /* LED OFF */
|
||||
break;
|
||||
break; /* LED OFF until state 1 */
|
||||
|
||||
case 2: /* LED no change */
|
||||
break;
|
||||
case 2:
|
||||
return; /* LED no change */
|
||||
|
||||
case 1:
|
||||
case 3:
|
||||
lpc43_gpio_write(GPIO_LED, true); /* LED ON */
|
||||
ledon = false; /* LED ON. Low illuminates */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Turn LED on or off, depending on state */
|
||||
|
||||
lpc43_gpio_write(GPIO_LED, ledon);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -183,13 +188,16 @@ void board_led_off(int led)
|
||||
default:
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
break; /* LED no change */
|
||||
|
||||
case 3:
|
||||
lpc43_gpio_write(GPIO_LED, false); /* LED OFF */
|
||||
break;
|
||||
break; /* LED OFF */
|
||||
|
||||
case 2:
|
||||
return; /* LED no change */
|
||||
}
|
||||
|
||||
/* LED OFF, Low illuminates */
|
||||
|
||||
lpc43_gpio_write(GPIO_LED, true);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
||||
|
@ -149,7 +149,7 @@ void lpc43_setled(int led, bool ledon)
|
||||
{
|
||||
if (led == BOARD_LED)
|
||||
{
|
||||
lpc43_gpio_write(GPIO_LED, ledon);
|
||||
lpc43_gpio_write(GPIO_LED, !ledon);
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ void lpc43_setled(int led, bool ledon)
|
||||
|
||||
void lpc43_setleds(uint8_t ledset)
|
||||
{
|
||||
lpc43_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) != 0);
|
||||
lpc43_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0);
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_ARCH_LEDS */
|
||||
|
Loading…
Reference in New Issue
Block a user