From 31365214931600db3fc4e5d6682b6eec08e8c18f Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 18 Jul 2018 15:06:01 -0700 Subject: [PATCH] px4fmu-v5:Fix led toggle. The phyical led read was not returing the logical state of the LED. Since they are active low, when on it was returning 0 and the the negation operation in togggle was makeing that a 1 which it already was. --- src/drivers/boards/px4fmu-v5/led.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/drivers/boards/px4fmu-v5/led.c b/src/drivers/boards/px4fmu-v5/led.c index c377851d90..5b5019a151 100644 --- a/src/drivers/boards/px4fmu-v5/led.c +++ b/src/drivers/boards/px4fmu-v5/led.c @@ -104,8 +104,8 @@ static void phy_set_led(int led, bool state) static bool phy_get_led(int led) { - - return stm32_gpioread(g_ledmap[led]); + /* If Low it is on */ + return !stm32_gpioread(g_ledmap[led]); } __EXPORT void led_on(int led) @@ -120,7 +120,6 @@ __EXPORT void led_off(int led) __EXPORT void led_toggle(int led) { - phy_set_led(xlat(led), !phy_get_led(xlat(led))); }