From b0cc60ccb23348d131fb6c1212cae60a45093a83 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 4 Mar 2015 18:24:46 +0100 Subject: [PATCH] [Taranis X9E] PLL fix --- .../Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c | 4 ++++ radio/src/targets/taranis/audio_driver.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/radio/src/targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c b/radio/src/targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c index 9fe1903e6..3df57c99b 100755 --- a/radio/src/targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c +++ b/radio/src/targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c @@ -313,7 +313,11 @@ /************************* PLL Parameters *************************************/ #if defined (STM32F40_41xxx) || defined (STM32F427_437xx) || defined (STM32F429_439xx) || defined (STM32F401xx) /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N */ +#if defined(REV9E) +#define PLL_M 12 +#else #define PLL_M 25 +#endif #else /* STM32F411xE */ #if defined (USE_HSE_BYPASS) #define PLL_M 8 diff --git a/radio/src/targets/taranis/audio_driver.cpp b/radio/src/targets/taranis/audio_driver.cpp index cec89fa7d..751e890db 100644 --- a/radio/src/targets/taranis/audio_driver.cpp +++ b/radio/src/targets/taranis/audio_driver.cpp @@ -47,10 +47,6 @@ bool dacIdle = true; void setSampleRate(uint32_t frequency) { -#if defined(REV9E) - frequency *= 2; -#endif - register uint32_t timer = (PERI1_FREQUENCY * TIMER_MULT_APB1) / frequency - 1 ; // MCK/8 and 100 000 Hz TIM6->CR1 &= ~TIM_CR1_CEN ;