You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2023/02/23 07:09:17 UTC
[mynewt-core] branch master updated: stm32h7: Fix APB1 divider conversion function
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new d54ab4206 stm32h7: Fix APB1 divider conversion function
d54ab4206 is described below
commit d54ab420688146d554c048379c5af8797ccf4d8b
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Feb 14 12:59:51 2023 +0100
stm32h7: Fix APB1 divider conversion function
Function was using incorrect constants for divider.
For STM32H7 APB clock has separate divider from HCLK which
is the case for other STM32 MCUs.
As a result timer based on APB1 where incorrectly setup
and run at different frequency that expected.
---
hw/mcu/stm/stm32h7xx/src/hal_timer_freq.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/mcu/stm/stm32h7xx/src/hal_timer_freq.c b/hw/mcu/stm/stm32h7xx/src/hal_timer_freq.c
index 7ab43215a..ad27c69d6 100644
--- a/hw/mcu/stm/stm32h7xx/src/hal_timer_freq.c
+++ b/hw/mcu/stm/stm32h7xx/src/hal_timer_freq.c
@@ -27,15 +27,15 @@ static uint32_t
stm32_hal_timer_abp_clk_div(uint32_t divider)
{
switch (divider) {
- case RCC_HCLK_DIV1:
+ case RCC_APB1_DIV1:
return 1;
- case RCC_HCLK_DIV2:
+ case RCC_APB1_DIV2:
return 2;
- case RCC_HCLK_DIV4:
+ case RCC_APB1_DIV4:
return 4;
- case RCC_HCLK_DIV8:
+ case RCC_APB1_DIV8:
return 8;
- case RCC_HCLK_DIV16:
+ case RCC_APB1_DIV16:
return 16;
}
return 0;