diff --git a/libraries/AP_BoardConfig/board_drivers.cpp b/libraries/AP_BoardConfig/board_drivers.cpp index 40b2a30647..6d59ea32d6 100644 --- a/libraries/AP_BoardConfig/board_drivers.cpp +++ b/libraries/AP_BoardConfig/board_drivers.cpp @@ -54,7 +54,7 @@ void AP_BoardConfig::board_init_safety() */ void AP_BoardConfig::board_init_debug() { -#ifndef HAL_BUILD_AP_PERIPH +#if !defined(HAL_BUILD_AP_PERIPH) && !defined(HAL_DEBUG_BUILD) if ((_options & BOARD_OPTION_DEBUG_ENABLE) == 0) { #ifdef HAL_GPIO_PIN_JTCK_SWCLK palSetLineMode(HAL_GPIO_PIN_JTCK_SWCLK, PAL_MODE_INPUT); @@ -63,7 +63,7 @@ void AP_BoardConfig::board_init_debug() palSetLineMode(HAL_GPIO_PIN_JTMS_SWDIO, PAL_MODE_INPUT); #endif } -#endif // HAL_BUILD_AP_PERIPH +#endif // HAL_BUILD_AP_PERIPH && HAL_DEBUG_BUILD }