mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
fix(boards/3dr/ctrl-n1): drive the PD10 LED push-pull, active high (#29372)
* fix(boards/3dr/ctrl-n1): drive the PD10 LED push-pull, active high The LED on PD10 lights when the pin drives high, and the board has no pull-up on that line. Configured as an open-drain output driven low to switch it on, it never lit, in the application nor in the bootloader. Drive it push-pull, initially low, and high to switch it on. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org> Assisted-by: Claude:opus-5.5 --------- Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org> Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
This commit is contained in:
1 parent
8bf63ef1c1
commit
ddc9474819
3 files changed
+7
-7
No files matched your search
@@ -45,7 +45,7 @@
|
||||
#include <stm32_gpio.h>
|
||||
|
||||
/* LEDs */
|
||||
#define GPIO_nLED_BL /* PD10 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN10)
|
||||
#define GPIO_nLED_BL /* PD10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN10)
|
||||
#define BOARD_LED 0
|
||||
|
||||
|
||||
|
||||
@@ -102,8 +102,8 @@
|
||||
|
||||
#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BL
|
||||
#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_BL
|
||||
#define BOARD_LED_ON 0
|
||||
#define BOARD_LED_OFF 1
|
||||
#define BOARD_LED_ON 1
|
||||
#define BOARD_LED_OFF 0
|
||||
|
||||
#define SERIAL_BREAK_DETECT_DISABLED 1
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ static void phy_set_led(int led, bool state)
|
||||
{
|
||||
if (led < 0 || (size_t)led >= sizeof(g_ledmap) / sizeof(g_ledmap[0])) { return; }
|
||||
|
||||
/* Drive Low to switch on */
|
||||
/* Drive High to switch on */
|
||||
if (g_ledmap[led] != 0) {
|
||||
stm32_gpiowrite(g_ledmap[led], !state);
|
||||
stm32_gpiowrite(g_ledmap[led], state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ static bool phy_get_led(int led)
|
||||
{
|
||||
if (led < 0 || (size_t)led >= sizeof(g_ledmap) / sizeof(g_ledmap[0])) { return false; }
|
||||
|
||||
/* If Low it is on */
|
||||
/* If High it is on */
|
||||
if (g_ledmap[led] != 0) {
|
||||
return !stm32_gpioread(g_ledmap[led]);
|
||||
return stm32_gpioread(g_ledmap[led]);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user