Improve support for JTAG/SWD pins reuse (#11963)
STM32 can reuse JTAG and SWD pins separately. Add `DISABLE_DEBUG` option to disable both interfaces and retain `DISABLE_JTAG` to disable JTAG only.
This commit is contained in:
committed by
Scott Lahteine
parent
7d5c336c56
commit
2ecfda80ac
@ -686,7 +686,16 @@ void setup() {
|
||||
max7219.init();
|
||||
#endif
|
||||
|
||||
#if ENABLED(DISABLE_JTAG)
|
||||
#if ENABLED(DISABLE_DEBUG)
|
||||
// Disable any hardware debug to free up pins for IO
|
||||
#ifdef JTAGSWD_DISABLE
|
||||
JTAGSWD_DISABLE();
|
||||
#elif defined(JTAG_DISABLE)
|
||||
JTAG_DISABLE();
|
||||
#else
|
||||
#error "DISABLE_DEBUG is not supported for the selected MCU/Board"
|
||||
#endif
|
||||
#elif ENABLED(DISABLE_JTAG)
|
||||
// Disable JTAG to free up pins for IO
|
||||
#ifdef JTAG_DISABLE
|
||||
JTAG_DISABLE();
|
||||
|
Reference in New Issue
Block a user