Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPIO alternate function initialisation removal for HAL. #12888

Merged
merged 1 commit into from Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/main/drivers/at32/timer_at32bsp.c
Expand Up @@ -670,11 +670,6 @@ _TIM_IRQ_HANDLER(TMR8_TRG_HALL_TMR14_IRQnHandler, 14);
_TIM_IRQ_HANDLER(TMR20_CH_IRQnHandler, 20);
#endif


void timerIOInit(void)
{
}

void timerInit(void)
{
memset(timerConfig, 0, sizeof(timerConfig));
Expand Down
11 changes: 0 additions & 11 deletions src/main/drivers/stm32/timer_hal.c
Expand Up @@ -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
// start timers
// TODO - Work in progress - initialization routine must be modified/verified to start correctly without timers
Expand Down
4 changes: 0 additions & 4 deletions src/main/drivers/stm32/timer_stdperiph.c
Expand Up @@ -851,10 +851,6 @@ void timerInit(void)
}
}

void timerIOInit(void)
{
// No-op
}
// finish configuring timers after allocation phase
// start timers
// TODO - Work in progress - initialization routine must be modified/verified to start correctly without timers
Expand Down
1 change: 0 additions & 1 deletion src/main/drivers/timer.h
Expand Up @@ -127,7 +127,6 @@ void timerConfigure(const timerHardware_t *timHw, uint16_t period, uint32_t hz);
// Initialisation
//
void timerInit(void);
void timerIOInit(void);
void timerStart(void);

//
Expand Down
9 changes: 0 additions & 9 deletions src/main/fc/init.c
Expand Up @@ -271,15 +271,6 @@ void init(void)
// initialize IO (needed for all IO operations)
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
detectHardwareRevision();
#endif
Expand Down
4 changes: 0 additions & 4 deletions src/main/target/SITL/sitl.c
Expand Up @@ -358,10 +358,6 @@ void timerInit(void)
printf("[timer]Init...\n");
}

void timerIOInit(void)
{
}

void timerStart(void)
{
}
Expand Down