Skip to content

Commit

Permalink
blackpill-f4: Add macro to control the bootloader LED
Browse files Browse the repository at this point in the history
Uses the new option introduced to select the LED
used for bootloader indication.
  • Loading branch information
sidprice committed Aug 29, 2024
1 parent 760d1d3 commit 1a9065d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/platforms/common/blackpill-f4/blackpill-f4.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,22 @@ extern bool debug_bmp;
gpio_set_val(LED_PORT, LED_ERROR, state); \
}

#ifdef ON_CARRIER_BOARD
/*
* When the Blackpill is mounted on a carrier board with a full set of LEDs,
* a separate BOOTLOADER LED is available.
*/
#define LED_BOOT_LED LED_BOOTLOADER
#define BOOT_STATE_INVERT false
#else
#define LED_BOOT_LED LED_IDLE_RUN
#define BOOT_STATE_INVERT true
#endif /* ON_CARRIER_BOARD */
// gpio_set_val(LED_PORT, LED_BOOT_LED, BOOT_STATE_INVERT ? !(state) : (state));

#define SET_BOOTLOADER_STATE(state) \
{ \
gpio_set_val(LED_PORT, LED_BOOT_LED, BOOT_STATE_INVERT ? !(state) : (state)); \
}

#endif /* PLATFORMS_COMMON_BLACKPILL_F4_H */

0 comments on commit 1a9065d

Please sign in to comment.