From aa940f7ac0e0677ce69858d48752a8e61190cdd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Mon, 2 Mar 2020 15:32:32 +0100 Subject: [PATCH] global: set DFU pin pre default to button, then BOOT1 --- global.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/global.h b/global.h index 358bf2c..7b4e181 100644 --- a/global.h +++ b/global.h @@ -658,14 +658,9 @@ /** @defgroup input to force DFU mode on low, even if application is valid * @{ */ -#if defined(MAPLE_MINI) - /* use button */ +#if defined(BUTTON_PIN) && defined(BUTTON_PRESSED) #define DFU_FORCE_PIN BUTTON_PIN /**< button pin */ - #define DFU_FORCE_VALUE BUTTON_PRESSED /**< button is pulled low unpressed, high pressed to force DFU mode */ -#elif defined(CORE_BOARD) - /* use button */ - #define DFU_FORCE_PIN BUTTON_PIN /**< button pin */ - #define DFU_FORCE_VALUE BUTTON_PRESSED /**< button floating unpressed, connected to ground pressed to force DFU mode */ + #define DFU_FORCE_VALUE BUTTON_PRESSED /**< start DFU when button is pressed on boot */ #elif defined(BLASTER) #define DFU_FORCE_PIN PA8 /**< GPIO pin (pin PA8, not SWD and UART pin on debug port) */ #define DFU_FORCE_VALUE 0 /**< short to nearby ground connection to force DFU */ @@ -680,9 +675,8 @@ #define DFU_FORCE_VALUE 1 /**< pin floating, set high when shorted with nearby VCC */ #endif #else - /* use the JNTRST pin as GPIO (SWJ will still be working, minus NTRST) */ - #define DFU_FORCE_PIN PB4 /**< JNTRST pin (needs to be remapped to become PB4) */ - #define DFU_FORCE_VALUE 0 /**< must be low to force DFU mode (note: JNTRST is also pulled up after reset) */ + #define DFU_FORCE_PIN PB2 /**< BOOT1 pin */ + #define DFU_FORCE_VALUE 1 /**< often connected to 0 by default to start system memory when BOOT0 = 1 */ #endif /** @} */