From 5b659407a6434a6b6bc0c85b2da96a422136e9cf Mon Sep 17 00:00:00 2001 From: ksschwabe Date: Tue, 25 Aug 2015 17:24:11 +0200 Subject: [PATCH] Bug fix: Incorrect APBs used in HRT driver and tone alarm driver. --- src/drivers/stm32/drv_hrt.c | 8 ++++---- src/drivers/stm32/tone_alarm/tone_alarm.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/drivers/stm32/drv_hrt.c b/src/drivers/stm32/drv_hrt.c index e37b750fe8..0ea6bd8d04 100644 --- a/src/drivers/stm32/drv_hrt.c +++ b/src/drivers/stm32/drv_hrt.c @@ -85,7 +85,7 @@ #elif HRT_TIMER == 2 # define HRT_TIMER_BASE STM32_TIM2_BASE # define HRT_TIMER_POWER_REG STM32_RCC_APB1ENR -# define HRT_TIMER_POWER_BIT RCC_APB2ENR_TIM2EN +# define HRT_TIMER_POWER_BIT RCC_APB1ENR_TIM2EN # define HRT_TIMER_VECTOR STM32_IRQ_TIM2 # define HRT_TIMER_CLOCK STM32_APB1_TIM2_CLKIN # if CONFIG_STM32_TIM2 @@ -103,7 +103,7 @@ #elif HRT_TIMER == 4 # define HRT_TIMER_BASE STM32_TIM4_BASE # define HRT_TIMER_POWER_REG STM32_RCC_APB1ENR -# define HRT_TIMER_POWER_BIT RCC_APB2ENR_TIM4EN +# define HRT_TIMER_POWER_BIT RCC_APB1ENR_TIM4EN # define HRT_TIMER_VECTOR STM32_IRQ_TIM4 # define HRT_TIMER_CLOCK STM32_APB1_TIM4_CLKIN # if CONFIG_STM32_TIM4 @@ -129,10 +129,10 @@ # endif #elif HRT_TIMER == 9 # define HRT_TIMER_BASE STM32_TIM9_BASE -# define HRT_TIMER_POWER_REG STM32_RCC_APB1ENR +# define HRT_TIMER_POWER_REG STM32_RCC_APB2ENR # define HRT_TIMER_POWER_BIT RCC_APB2ENR_TIM9EN # define HRT_TIMER_VECTOR STM32_IRQ_TIM1BRK -# define HRT_TIMER_CLOCK STM32_APB1_TIM9_CLKIN +# define HRT_TIMER_CLOCK STM32_APB2_TIM9_CLKIN # if CONFIG_STM32_TIM9 # error must not set CONFIG_STM32_TIM9=y and HRT_TIMER=9 # endif diff --git a/src/drivers/stm32/tone_alarm/tone_alarm.cpp b/src/drivers/stm32/tone_alarm/tone_alarm.cpp index 17f4c9362b..beffbdd8b6 100644 --- a/src/drivers/stm32/tone_alarm/tone_alarm.cpp +++ b/src/drivers/stm32/tone_alarm/tone_alarm.cpp @@ -148,22 +148,22 @@ # endif #elif TONE_ALARM_TIMER == 9 # define TONE_ALARM_BASE STM32_TIM9_BASE -# define TONE_ALARM_CLOCK STM32_APB1_TIM9_CLKIN -# define TONE_ALARM_CLOCK_ENABLE RCC_APB1ENR_TIM9EN +# define TONE_ALARM_CLOCK STM32_APB2_TIM9_CLKIN +# define TONE_ALARM_CLOCK_ENABLE RCC_APB2ENR_TIM9EN # ifdef CONFIG_STM32_TIM9 # error Must not set CONFIG_STM32_TIM9 when TONE_ALARM_TIMER is 9 # endif #elif TONE_ALARM_TIMER == 10 # define TONE_ALARM_BASE STM32_TIM10_BASE -# define TONE_ALARM_CLOCK STM32_APB1_TIM10_CLKIN -# define TONE_ALARM_CLOCK_ENABLE RCC_APB1ENR_TIM10EN +# define TONE_ALARM_CLOCK STM32_APB2_TIM10_CLKIN +# define TONE_ALARM_CLOCK_ENABLE RCC_APB2ENR_TIM10EN # ifdef CONFIG_STM32_TIM10 # error Must not set CONFIG_STM32_TIM10 when TONE_ALARM_TIMER is 10 # endif #elif TONE_ALARM_TIMER == 11 # define TONE_ALARM_BASE STM32_TIM11_BASE -# define TONE_ALARM_CLOCK STM32_APB1_TIM11_CLKIN -# define TONE_ALARM_CLOCK_ENABLE RCC_APB1ENR_TIM11EN +# define TONE_ALARM_CLOCK STM32_APB2_TIM11_CLKIN +# define TONE_ALARM_CLOCK_ENABLE RCC_APB2ENR_TIM11EN # ifdef CONFIG_STM32_TIM11 # error Must not set CONFIG_STM32_TIM11 when TONE_ALARM_TIMER is 11 # endif