From 540f5f8fcc9010a10f9dc6bc87c0ab47a37a5d3a Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Thu, 24 Nov 2022 11:01:33 +0100 Subject: [PATCH] sys/riotboot: use BTN0_MODE for default value of BTN_BOOTLOADER_INVERTED --- sys/include/riotboot/bootloader_selection.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/include/riotboot/bootloader_selection.h b/sys/include/riotboot/bootloader_selection.h index 52ba3133077e1..b0fc8ff669537 100644 --- a/sys/include/riotboot/bootloader_selection.h +++ b/sys/include/riotboot/bootloader_selection.h @@ -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 *