mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
Revert "Remove superfluous timerHardware properties"
This reverts commit 4924894f41
.
Just too many combinations on the F3 for using a simple mapping table - wastes too much memory.
Will move LED Strip to allocation based on timerHardware_t array once DSHOT is merged (uses same dma requirements).
This commit is contained in:
parent
c96bb34fda
commit
e840bbe83c
80 changed files with 564 additions and 581 deletions
|
@ -207,18 +207,6 @@ rccPeriphTag_t timerRCC(TIM_TypeDef *tim)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(STM32F3) || defined(STM32F4)
|
||||
uint8_t timerGPIOAF(TIM_TypeDef *tim)
|
||||
{
|
||||
for (uint8_t i = 0; i < HARDWARE_TIMER_DEFINITION_COUNT; i++) {
|
||||
if (timerDefinitions[i].TIMx == tim) {
|
||||
return timerDefinitions[i].alternateFunction;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void timerNVICConfigure(uint8_t irq)
|
||||
{
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
|
@ -720,11 +708,10 @@ void timerInit(void)
|
|||
RCC_ClockCmd(timerRCC(timerHardware[i].tim), ENABLE);
|
||||
}
|
||||
|
||||
/* TODO: remove this in favour of setting up at the time of initilisation of the feature using the timer */
|
||||
#if defined(STM32F3) || defined(STM32F4)
|
||||
for (uint8_t timerIndex = 0; timerIndex < USABLE_TIMER_CHANNEL_COUNT; timerIndex++) {
|
||||
const timerHardware_t *timerHardwarePtr = &timerHardware[timerIndex];
|
||||
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), timerHardwarePtr->ioMode, timerGPIOAF(timerHardwarePtr->tim));
|
||||
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), timerHardwarePtr->ioMode, timerHardwarePtr->alternateFunction);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue