summaryrefslogtreecommitdiff
path: root/chip/stm32/clock-stm32l.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/clock-stm32l.c')
-rw-r--r--chip/stm32/clock-stm32l.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/chip/stm32/clock-stm32l.c b/chip/stm32/clock-stm32l.c
index e0c7ebc747..c8b8bc0683 100644
--- a/chip/stm32/clock-stm32l.c
+++ b/chip/stm32/clock-stm32l.c
@@ -50,6 +50,19 @@ int clock_get_freq(void)
return freq;
}
+void clock_wait_bus_cycles(enum bus_type bus, uint32_t cycles)
+{
+ volatile uint32_t dummy __attribute__((unused));
+
+ if (bus == BUS_AHB) {
+ while (cycles--)
+ dummy = STM32_DMA1_REGS->isr;
+ } else { /* APB */
+ while (cycles--)
+ dummy = STM32_USART_BRR(STM32_USART1_BASE);
+ }
+}
+
/**
* Set which oscillator is used for the clock
*