Skip to content

Commit

Permalink
platforms/blackpill-f4: add #ifdef around second setup of LED_BOOTLOA…
Browse files Browse the repository at this point in the history
…DER, to prevent setting up LED_BOOTLOADER twice
  • Loading branch information
lenvm committed Jan 15, 2025
1 parent d643492 commit 7efd034
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/platforms/common/blackpill-f4/blackpill-f4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7efd034

Please sign in to comment.