lpc11u35 - Invert led logic to match hardware
The lpc11u35 hdk, like the other hdks, has active low leds. This patch
updates the gpio driver to treat these leds as active low, so passing
in the value GPIO_LED_ON to gpio_set_*_led turns the led on rather
than off.
@@ -162,27 +162,27 @@ void gpio_init(void)
void gpio_set_hid_led(gpio_led_state_t state)
{
if (state) {
- LPC_GPIO->SET[PIN_DAP_LED_PORT] = PIN_DAP_LED;
- } else {
LPC_GPIO->CLR[PIN_DAP_LED_PORT] = PIN_DAP_LED;
+ } else {
+ LPC_GPIO->SET[PIN_DAP_LED_PORT] = PIN_DAP_LED;
}
}
void gpio_set_cdc_led(gpio_led_state_t state)
{
if (state) {
- LPC_GPIO->SET[PIN_CDC_LED_PORT] = PIN_CDC_LED;
- } else {
LPC_GPIO->CLR[PIN_CDC_LED_PORT] = PIN_CDC_LED;
+ } else {
+ LPC_GPIO->SET[PIN_CDC_LED_PORT] = PIN_CDC_LED;
}
}
void gpio_set_msc_led(gpio_led_state_t state)
{
if (state) {
- LPC_GPIO->SET[PIN_MSD_LED_PORT] = PIN_MSD_LED;
- } else {
LPC_GPIO->CLR[PIN_MSD_LED_PORT] = PIN_MSD_LED;
+ } else {
+ LPC_GPIO->SET[PIN_MSD_LED_PORT] = PIN_MSD_LED;
}
}
