mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Merge branch 'master' into attitude_estimator_q_voting
This commit is contained in:
commit
9be3331d9b
@ -105,7 +105,7 @@
|
||||
#elif PWMIN_TIMER == 2
|
||||
# define PWMIN_TIMER_BASE STM32_TIM2_BASE
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB2ENR_TIM2EN
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB1ENR_TIM2EN
|
||||
# define PWMIN_TIMER_VECTOR STM32_IRQ_TIM2
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB1_TIM2_CLKIN
|
||||
#elif PWMIN_TIMER == 3
|
||||
@ -123,7 +123,7 @@
|
||||
#elif PWMIN_TIMER == 5
|
||||
# define PWMIN_TIMER_BASE STM32_TIM5_BASE
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB2ENR_TIM5EN
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB1ENR_TIM5EN
|
||||
# define PWMIN_TIMER_VECTOR STM32_IRQ_TIM5
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB1_TIM5_CLKIN
|
||||
#elif PWMIN_TIMER == 8
|
||||
@ -134,28 +134,28 @@
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB2_TIM8_CLKIN
|
||||
#elif PWMIN_TIMER == 9
|
||||
# define PWMIN_TIMER_BASE STM32_TIM9_BASE
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB2ENR
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB2ENR_TIM9EN
|
||||
# define PWMIN_TIMER_VECTOR STM32_IRQ_TIM1BRK
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB1_TIM9_CLKIN
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB2_TIM9_CLKIN
|
||||
#elif PWMIN_TIMER == 10
|
||||
# define PWMIN_TIMER_BASE STM32_TIM10_BASE
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB2ENR
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB2ENR_TIM10EN
|
||||
# define PWMIN_TIMER_VECTOR STM32_IRQ_TIM1UP
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB2_TIM10_CLKIN
|
||||
#elif PWMIN_TIMER == 11
|
||||
# define PWMIN_TIMER_BASE STM32_TIM11_BASE
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB2ENR
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB2ENR_TIM11EN
|
||||
# define PWMIN_TIMER_VECTOR STM32_IRQ_TIM1TRGCOM
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB2_TIM11_CLKIN
|
||||
#elif PWMIN_TIMER == 12
|
||||
# define PWMIN_TIMER_BASE STM32_TIM12_BASE
|
||||
# define PWMIN_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB2ENR_TIM12EN
|
||||
# define PWMIN_TIMER_VECTOR STM32_IRQ_TIM1TRGCOM
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB2_TIM12_CLKIN
|
||||
# define PWMIN_TIMER_POWER_BIT RCC_APB1ENR_TIM12EN
|
||||
# define PWMIN_TIMER_VECTOR STM32_IRQ_TIM8BRK
|
||||
# define PWMIN_TIMER_CLOCK STM32_APB1_TIM12_CLKIN
|
||||
#else
|
||||
# error PWMIN_TIMER must be a value between 1 and 12
|
||||
#endif
|
||||
|
||||
@ -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
|
||||
@ -112,7 +112,7 @@
|
||||
#elif HRT_TIMER == 5
|
||||
# define HRT_TIMER_BASE STM32_TIM5_BASE
|
||||
# define HRT_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define HRT_TIMER_POWER_BIT RCC_APB2ENR_TIM5EN
|
||||
# define HRT_TIMER_POWER_BIT RCC_APB1ENR_TIM5EN
|
||||
# define HRT_TIMER_VECTOR STM32_IRQ_TIM5
|
||||
# define HRT_TIMER_CLOCK STM32_APB1_TIM5_CLKIN
|
||||
# if CONFIG_STM32_TIM5
|
||||
@ -129,16 +129,16 @@
|
||||
# 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
|
||||
#elif HRT_TIMER == 10
|
||||
# define HRT_TIMER_BASE STM32_TIM10_BASE
|
||||
# define HRT_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define HRT_TIMER_POWER_REG STM32_RCC_APB2ENR
|
||||
# define HRT_TIMER_POWER_BIT RCC_APB2ENR_TIM10EN
|
||||
# define HRT_TIMER_VECTOR STM32_IRQ_TIM1UP
|
||||
# define HRT_TIMER_CLOCK STM32_APB2_TIM10_CLKIN
|
||||
@ -147,7 +147,7 @@
|
||||
# endif
|
||||
#elif HRT_TIMER == 11
|
||||
# define HRT_TIMER_BASE STM32_TIM11_BASE
|
||||
# define HRT_TIMER_POWER_REG STM32_RCC_APB1ENR
|
||||
# define HRT_TIMER_POWER_REG STM32_RCC_APB2ENR
|
||||
# define HRT_TIMER_POWER_BIT RCC_APB2ENR_TIM11EN
|
||||
# define HRT_TIMER_VECTOR STM32_IRQ_TIM1TRGCOM
|
||||
# define HRT_TIMER_CLOCK STM32_APB2_TIM11_CLKIN
|
||||
|
||||
@ -121,6 +121,7 @@
|
||||
#if TONE_ALARM_TIMER == 2
|
||||
# define TONE_ALARM_BASE STM32_TIM2_BASE
|
||||
# define TONE_ALARM_CLOCK STM32_APB1_TIM2_CLKIN
|
||||
# define TONE_ALARM_CLOCK_POWER_REG STM32_RCC_APB1ENR
|
||||
# define TONE_ALARM_CLOCK_ENABLE RCC_APB1ENR_TIM2EN
|
||||
# ifdef CONFIG_STM32_TIM2
|
||||
# error Must not set CONFIG_STM32_TIM2 when TONE_ALARM_TIMER is 2
|
||||
@ -128,6 +129,7 @@
|
||||
#elif TONE_ALARM_TIMER == 3
|
||||
# define TONE_ALARM_BASE STM32_TIM3_BASE
|
||||
# define TONE_ALARM_CLOCK STM32_APB1_TIM3_CLKIN
|
||||
# define TONE_ALARM_CLOCK_POWER_REG STM32_RCC_APB1ENR
|
||||
# define TONE_ALARM_CLOCK_ENABLE RCC_APB1ENR_TIM3EN
|
||||
# ifdef CONFIG_STM32_TIM3
|
||||
# error Must not set CONFIG_STM32_TIM3 when TONE_ALARM_TIMER is 3
|
||||
@ -135,6 +137,7 @@
|
||||
#elif TONE_ALARM_TIMER == 4
|
||||
# define TONE_ALARM_BASE STM32_TIM4_BASE
|
||||
# define TONE_ALARM_CLOCK STM32_APB1_TIM4_CLKIN
|
||||
# define TONE_ALARM_CLOCK_POWER_REG STM32_RCC_APB1ENR
|
||||
# define TONE_ALARM_CLOCK_ENABLE RCC_APB1ENR_TIM4EN
|
||||
# ifdef CONFIG_STM32_TIM4
|
||||
# error Must not set CONFIG_STM32_TIM4 when TONE_ALARM_TIMER is 4
|
||||
@ -142,28 +145,32 @@
|
||||
#elif TONE_ALARM_TIMER == 5
|
||||
# define TONE_ALARM_BASE STM32_TIM5_BASE
|
||||
# define TONE_ALARM_CLOCK STM32_APB1_TIM5_CLKIN
|
||||
# define TONE_ALARM_CLOCK_POWER_REG STM32_RCC_APB1ENR
|
||||
# define TONE_ALARM_CLOCK_ENABLE RCC_APB1ENR_TIM5EN
|
||||
# ifdef CONFIG_STM32_TIM5
|
||||
# error Must not set CONFIG_STM32_TIM5 when TONE_ALARM_TIMER is 5
|
||||
# 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_POWER_REG STM32_RCC_APB2ENR
|
||||
# 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_POWER_REG STM32_RCC_APB2ENR
|
||||
# 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_POWER_REG STM32_RCC_APB2ENR
|
||||
# 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
|
||||
@ -376,7 +383,7 @@ ToneAlarm::init()
|
||||
stm32_configgpio(GPIO_TONE_ALARM_IDLE);
|
||||
|
||||
/* clock/power on our timer */
|
||||
modifyreg32(STM32_RCC_APB1ENR, 0, TONE_ALARM_CLOCK_ENABLE);
|
||||
modifyreg32(TONE_ALARM_CLOCK_POWER_REG, 0, TONE_ALARM_CLOCK_ENABLE);
|
||||
|
||||
/* initialise the timer */
|
||||
rCR1 = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user