1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +03:00

GPIO alternate function initialisation removal for HAL. (#12888)

GPIO alternate function removal for HAL.

The all timer initialisation was actually not required as the initialisation is located where needed (previously required for STD PERIPH / AT32). The previous for loop excluded the actual setup in any case as all the full timer hardware items where TIM_USE_ANY.
This commit is contained in:
J Blackman 2023-06-17 01:53:21 +10:00 committed by GitHub
parent b8855d3a71
commit 70b9c7fb66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 34 deletions

View file

@ -670,11 +670,6 @@ _TIM_IRQ_HANDLER(TMR8_TRG_HALL_TMR14_IRQnHandler, 14);
_TIM_IRQ_HANDLER(TMR20_CH_IRQnHandler, 20); _TIM_IRQ_HANDLER(TMR20_CH_IRQnHandler, 20);
#endif #endif
void timerIOInit(void)
{
}
void timerInit(void) void timerInit(void)
{ {
memset(timerConfig, 0, sizeof(timerConfig)); memset(timerConfig, 0, sizeof(timerConfig));

View file

@ -1043,17 +1043,6 @@ void timerInit(void)
} }
} }
void timerIOInit(void)
{
#if defined(STM32F4) || defined(STM32F7) || defined(STM32H7)
for (unsigned timerIndex = 0; timerIndex < TIMER_CHANNEL_COUNT; timerIndex++) {
const timerHardware_t *timerHardwarePtr = &TIMER_HARDWARE[timerIndex];
// XXX IOConfigGPIOAF in timerInit should eventually go away.
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction);
}
#endif
}
// finish configuring timers after allocation phase // finish configuring timers after allocation phase
// start timers // start timers
// TODO - Work in progress - initialization routine must be modified/verified to start correctly without timers // TODO - Work in progress - initialization routine must be modified/verified to start correctly without timers

View file

@ -851,10 +851,6 @@ void timerInit(void)
} }
} }
void timerIOInit(void)
{
// No-op
}
// finish configuring timers after allocation phase // finish configuring timers after allocation phase
// start timers // start timers
// TODO - Work in progress - initialization routine must be modified/verified to start correctly without timers // TODO - Work in progress - initialization routine must be modified/verified to start correctly without timers

View file

@ -127,7 +127,6 @@ void timerConfigure(const timerHardware_t *timHw, uint16_t period, uint32_t hz);
// Initialisation // Initialisation
// //
void timerInit(void); void timerInit(void);
void timerIOInit(void);
void timerStart(void); void timerStart(void);
// //

View file

@ -271,15 +271,6 @@ void init(void)
// initialize IO (needed for all IO operations) // initialize IO (needed for all IO operations)
IOInitGlobal(); IOInitGlobal();
#ifdef USE_TIMER
// timerIOInit blindly reconfigures GPIO AF for all pins in the fullTimerHardware array regardless
// of if the timer pin is used already by something else.
// If it is called AFTER the SPI initilisation, any AF settings for the SPI are overridden by timer
// AF, making the SPI hang when it's used.
// To work-around this issue init timer AF before other AF, such as SPI/QSPI/OSPI/etc.
timerIOInit();
#endif
#ifdef USE_HARDWARE_REVISION_DETECTION #ifdef USE_HARDWARE_REVISION_DETECTION
detectHardwareRevision(); detectHardwareRevision();
#endif #endif

View file

@ -358,10 +358,6 @@ void timerInit(void)
printf("[timer]Init...\n"); printf("[timer]Init...\n");
} }
void timerIOInit(void)
{
}
void timerStart(void) void timerStart(void)
{ {
} }