stm32: Enable optimized gpio_clock_enable() function on stm32h7

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-12-18 20:54:11 -05:00
parent e56b63fd7e
commit dc3ac2b424
1 changed files with 3 additions and 1 deletions

View File

@ -100,7 +100,9 @@ get_pclock_frequency(uint32_t periph_base)
void void
gpio_clock_enable(GPIO_TypeDef *regs) gpio_clock_enable(GPIO_TypeDef *regs)
{ {
enable_pclock((uint32_t)regs); uint32_t pos = ((uint32_t)regs - D3_APB1PERIPH_BASE) / 0x400;
RCC->APB4ENR |= (1<<pos);
RCC->APB4ENR;
} }
#if !CONFIG_STM32_CLOCK_REF_INTERNAL #if !CONFIG_STM32_CLOCK_REF_INTERNAL