mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-04 12:50:36 +08:00
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.
This commit is contained in:
committed by
Lorenz Meier
parent
1db1155697
commit
3136521493
@@ -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)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user