From 3f1c5eea9b1ea1e9425a53917c9b1c0e5973ab3a Mon Sep 17 00:00:00 2001 From: lenvm Date: Thu, 19 Oct 2023 18:22:55 +0200 Subject: [PATCH] platforms/blackpill-f4: add #ifdef around second setup of LED_BOOTLOADER, to prevent setting up LED_BOOTLOADER twice --- src/platforms/common/blackpill-f4/blackpill-f4.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platforms/common/blackpill-f4/blackpill-f4.c b/src/platforms/common/blackpill-f4/blackpill-f4.c index 649cf9cc320..55edfa808ac 100644 --- a/src/platforms/common/blackpill-f4/blackpill-f4.c +++ b/src/platforms/common/blackpill-f4/blackpill-f4.c @@ -114,7 +114,11 @@ void platform_init(void) gpio_set_output_options(TRST_PORT, GPIO_OTYPE_OD, GPIO_OSPEED_2MHZ, TRST_PIN); /* Set up LED pins */ - gpio_mode_setup(LED_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_IDLE_RUN | LED_ERROR | LED_BOOTLOADER); + gpio_mode_setup(LED_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_IDLE_RUN | LED_ERROR); + /* Set up LED_BOOTLOADER if it hasn't been set up yet in the bootloader section above */ +#ifdef BMP_BOOTLOADER + gpio_mode_setup(LED_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_BOOTLOADER); +#endif gpio_mode_setup(LED_PORT_UART, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_UART); #ifdef PLATFORM_HAS_POWER_SWITCH