Skip to content

Commit

Permalink
sys/riotboot: use BTN0_MODE for default value of BTN_BOOTLOADER_INVERTED
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Nov 24, 2022
1 parent f58413b commit 540f5f8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sys/include/riotboot/bootloader_selection.h
Expand Up @@ -61,12 +61,17 @@ extern "C" {
* Set to true for active-low buttons (go to DFU if the pin is low), otherwise
* to false (go to DFU if the pin is high).
*
* The default value for all boards is inverted (active-low).
*
* */
* The default value for all boards is inverted (active-low), except if
* BTN0_MODE is defined as GPIO_IN_PD. In this case the value is not
* inverted (high-active).
*/
#ifndef BTN_BOOTLOADER_INVERTED
#if (BTN0_MODE == GPIO_IN_PD)
#define BTN_BOOTLOADER_INVERTED false
#else
#define BTN_BOOTLOADER_INVERTED true
#endif
#endif

/** @brief LED pin for bootloader indication
*
Expand Down

0 comments on commit 540f5f8

Please sign in to comment.