aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32h7.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-12-18 20:54:11 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-12-23 22:15:25 -0500
commitdc3ac2b424dc2f915f825227ac941ab1b982ed21 (patch)
treeb0d50347d6303f6dab41b9d98eaaab9764bcadde /src/stm32/stm32h7.c
parente56b63fd7e4400b8c6bca5d42d53dd6786f2a293 (diff)
downloadkutter-dc3ac2b424dc2f915f825227ac941ab1b982ed21.tar.gz
kutter-dc3ac2b424dc2f915f825227ac941ab1b982ed21.tar.xz
kutter-dc3ac2b424dc2f915f825227ac941ab1b982ed21.zip
stm32: Enable optimized gpio_clock_enable() function on stm32h7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/stm32h7.c')
-rw-r--r--src/stm32/stm32h7.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stm32/stm32h7.c b/src/stm32/stm32h7.c
index cd5ed0c6..4edab5f0 100644
--- a/src/stm32/stm32h7.c
+++ b/src/stm32/stm32h7.c
@@ -100,7 +100,9 @@ get_pclock_frequency(uint32_t periph_base)
void
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