diff --git a/src/main/drivers/timer.c b/src/main/drivers/timer.c index a53128bbdd..d51aa743eb 100755 --- a/src/main/drivers/timer.c +++ b/src/main/drivers/timer.c @@ -709,6 +709,9 @@ void timerInit(void) #if defined(STM32F3) || defined(STM32F4) for (int timerIndex = 0; timerIndex < USABLE_TIMER_CHANNEL_COUNT; timerIndex++) { const timerHardware_t *timerHardwarePtr = &timerHardware[timerIndex]; + if (timerHardwarePtr->usageFlags == TIM_USE_NONE) { + continue; + } IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction); } #endif diff --git a/src/main/drivers/timer_hal.c b/src/main/drivers/timer_hal.c index 95653b4517..4aeb43ca44 100644 --- a/src/main/drivers/timer_hal.c +++ b/src/main/drivers/timer_hal.c @@ -807,6 +807,9 @@ void timerInit(void) #if defined(STM32F3) || defined(STM32F4) || defined(STM32F7) for (int timerIndex = 0; timerIndex < USABLE_TIMER_CHANNEL_COUNT; timerIndex++) { const timerHardware_t *timerHardwarePtr = &timerHardware[timerIndex]; + if (timerHardwarePtr->usageFlags == TIM_USE_NONE) { + continue; + } IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction); } #endif