From 564c442ac8f02d4220358d0c63d145f8b4e24d99 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 28 May 2012 20:28:48 -0500 Subject: [PATCH] Remove some code from Zippe that used a timer to trigger the ADC. We might do this again in the future but we need to generalize the configuration. For now the ADC is fairly simple requirements on revo for battery monitoring. --- flight/PiOS/STM32F4xx/pios_adc.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/flight/PiOS/STM32F4xx/pios_adc.c b/flight/PiOS/STM32F4xx/pios_adc.c index 05759170d..c88ccd5c4 100644 --- a/flight/PiOS/STM32F4xx/pios_adc.c +++ b/flight/PiOS/STM32F4xx/pios_adc.c @@ -94,7 +94,6 @@ static bool PIOS_ADC_validate(struct pios_adc_dev *); #if defined(PIOS_INCLUDE_ADC) static void init_pins(void); static void init_dma(void); -static void init_timer(void); static void init_adc(void); #endif @@ -176,33 +175,6 @@ init_dma(void) NVIC_Init(&NVICInit); } -#if 0 -static void -init_timer(void) -{ - RCC_ClocksTypeDef clocks; - TIM_TimeBaseInitTypeDef TIMInit; - - /* get clock info */ - RCC_GetClocksFreq(&clocks); - - /* reset/disable the timer */ - TIM_DeInit(PIOS_ADC_TIMER); - - /* configure for 1kHz auto-reload cycle */ - TIM_TimeBaseStructInit(&TIMInit); - TIMInit.TIM_Prescaler = clocks.PCLK1_Frequency / 1000000; /* 1MHz base clock*/ - TIMInit.TIM_CounterMode = TIM_CounterMode_Down; - TIMInit.TIM_Period = 1000; /* 1kHz conversion rate */ - TIMInit.TIM_ClockDivision = TIM_CKD_DIV1; /* no additional divisor */ - TIM_TimeBaseInit(PIOS_ADC_TIMER, &TIMInit); - - /* configure trigger output on reload */ - TIM_SelectOutputTrigger(PIOS_ADC_TIMER, TIM_TRGOSource_Update); - TIM_Cmd(PIOS_ADC_TIMER, ENABLE); -} -#endif - static void init_adc(void) { @@ -300,7 +272,6 @@ int32_t PIOS_ADC_Init(const struct pios_adc_cfg * cfg) #if defined(PIOS_INCLUDE_ADC) init_pins(); init_dma(); - //init_timer(); init_adc(); #endif