busvoodoo_global: disable SWJ for dongle

This commit is contained in:
King Kévin 2020-03-09 16:56:39 +01:00
parent 4ca7fa65ec
commit db98878e63
1 changed files with 7 additions and 0 deletions

View File

@ -91,6 +91,13 @@ void busvoodoo_setup(void)
rcc_periph_clock_enable(RCC_GPIOC); // enable clock for all GPIO domains
rcc_periph_clock_enable(RCC_GPIOD); // enable clock for all GPIO domains
rcc_periph_clock_enable(RCC_AFIO); // enable clock for alternate function (for communication)
#if BUSVOODOO_HARDWARE_VERSION == 2
#if DEBUG
gpio_primary_remap(AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON, 0); // disable JTAG to get PA15 as GPIO
#else
gpio_primary_remap(AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_OFF, 0); // disable JTAG to get PA15 as GPIO, and SWD to not interfere
#endif
#endif
busvoodoo_safe_state(); // put pins in safe state (for common light version)
#if BUSVOODOO_HARDWARE_VERSION != 2