global: set DFU pin pre default to button, then BOOT1

This commit is contained in:
King Kévin 2020-03-02 15:32:32 +01:00
parent 699e46521f
commit aa940f7ac0
1 changed files with 4 additions and 10 deletions

View File

@ -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
/** @} */