Merge pull request #3991 from jflyper/bfdev-avoid-over-initialization-of-timer-pins

Avoid initializing TIM_USE_NONE pins
This commit is contained in:
Martin Budden 2017-08-31 19:56:46 +01:00 committed by GitHub
commit cafb8aeb02
2 changed files with 8 additions and 0 deletions

View File

@ -709,6 +709,10 @@ 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;
}
// XXX IOConfigGPIOAF in timerInit should eventually go away.
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction);
}
#endif

View File

@ -807,6 +807,10 @@ 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;
}
// XXX IOConfigGPIOAF in timerInit should eventually go away.
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction);
}
#endif