From 3f76591b3616c07c5a02624aff8649d5fa7e9f4b Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Thu, 17 Feb 2011 23:47:31 -0500 Subject: Generalizing adc_init() to allow user to select sample time --- wirish/wirish.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'wirish/wirish.c') diff --git a/wirish/wirish.c b/wirish/wirish.c index 5935f95..aaae9d4 100644 --- a/wirish/wirish.c +++ b/wirish/wirish.c @@ -54,7 +54,7 @@ void init(void) { #if NR_DAC_PINS > 0 dac_init(); #endif - + /* initialize clocks */ rcc_clk_init(RCC_CLKSRC_PLL, RCC_PLLSRC_HSE, RCC_PLLMUL_9); rcc_set_prescaler(RCC_PRESCALER_AHB, RCC_AHB_SYSCLK_DIV_1); @@ -64,7 +64,9 @@ void init(void) { nvic_init(); systick_init(SYSTICK_RELOAD_VAL); gpio_init(); - adc_init(); + /* Initialize the ADC for slow conversions, to allow for high + impedance inputs. */ + adc_init(ADC_SMPR_55_5); timer_init(TIMER1, 1); timer_init(TIMER2, 1); timer_init(TIMER3, 1); -- cgit v1.2.3