From ddc9474819bca97df2c361cef553009a8decd29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Wed, 21 Oct 2026 21:16:35 +0200 Subject: [PATCH] fix(boards/3dr/ctrl-n1): drive the PD10 LED push-pull, active high (#29372) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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é Assisted-by: Claude:opus-5.5 --------- Signed-off-by: Benjamin Cabé Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com> --- boards/3dr/ctrl-n1/src/board_config.h | 2 +- boards/3dr/ctrl-n1/src/hw_config.h | 4 ++-- boards/3dr/ctrl-n1/src/led.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/boards/3dr/ctrl-n1/src/board_config.h b/boards/3dr/ctrl-n1/src/board_config.h index 84d21c0507a..a81a82acaef 100755 --- a/boards/3dr/ctrl-n1/src/board_config.h +++ b/boards/3dr/ctrl-n1/src/board_config.h @@ -45,7 +45,7 @@ #include /* 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 diff --git a/boards/3dr/ctrl-n1/src/hw_config.h b/boards/3dr/ctrl-n1/src/hw_config.h index f00aebea63d..3d052a545e9 100755 --- a/boards/3dr/ctrl-n1/src/hw_config.h +++ b/boards/3dr/ctrl-n1/src/hw_config.h @@ -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 diff --git a/boards/3dr/ctrl-n1/src/led.c b/boards/3dr/ctrl-n1/src/led.c index 7266524192a..bf54d8820d4 100755 --- a/boards/3dr/ctrl-n1/src/led.c +++ b/boards/3dr/ctrl-n1/src/led.c @@ -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;