diff --git a/platforms/nuttx/src/px4/stm/stm32_common/tone_alarm/ToneAlarmInterfacePWM.cpp b/platforms/nuttx/src/px4/stm/stm32_common/tone_alarm/ToneAlarmInterfacePWM.cpp index 6ba13e65ac..f83cdfebea 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/tone_alarm/ToneAlarmInterfacePWM.cpp +++ b/platforms/nuttx/src/px4/stm/stm32_common/tone_alarm/ToneAlarmInterfacePWM.cpp @@ -48,6 +48,24 @@ #define TONE_ALARM_COUNTER_PERIOD 65536 #endif +/* The H7 has a 2 RCC_APB1ENR registers RCC_APB1LENR and RCC_APB1HENR + * We simply map the RCC_APB1LENR back to STM32_RCC_APB1ENR as well as + * the bits + */ + +#if !defined(STM32_RCC_APB1ENR) && defined(STM32_RCC_APB1LENR) +# define STM32_RCC_APB1ENR STM32_RCC_APB1LENR + +# define RCC_APB1ENR_TIM2EN RCC_APB1LENR_TIM2EN +# define RCC_APB1ENR_TIM3EN RCC_APB1LENR_TIM3EN +# define RCC_APB1ENR_TIM4EN RCC_APB1LENR_TIM4EN +# define RCC_APB1ENR_TIM5EN RCC_APB1LENR_TIM5EN +# define RCC_APB1ENR_TIM6EN RCC_APB1LENR_TIM6EN +# define RCC_APB1ENR_TIM7EN RCC_APB1LENR_TIM7EN +# define RCC_APB1ENR_TIM12EN RCC_APB1LENR_TIM12EN +# define RCC_APB1ENR_TIM13EN RCC_APB1LENR_TIM13EN +# define RCC_APB1ENR_TIM14EN RCC_APB1LENR_TIM14EN +#endif /* Tone alarm configuration */ #if TONE_ALARM_TIMER == 1 # define TONE_ALARM_BASE STM32_TIM1_BASE