From: Keith Packard Date: Tue, 9 Aug 2016 05:39:16 +0000 (-0700) Subject: altos/stmf0: Switch ADC fast to ADC clock X-Git-Tag: 1.6.8~1^2~20 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=46b1234140c04dbfac22be0fdf80be96506b6948 altos/stmf0: Switch ADC fast to ADC clock Using this slower clock eliminates sampling problems with the ADC and cleans up the chaoskey raw data. Signed-off-by: Keith Packard --- diff --git a/src/stmf0/ao_adc_fast.c b/src/stmf0/ao_adc_fast.c index fbf4ad2e..5ce3a396 100644 --- a/src/stmf0/ao_adc_fast.c +++ b/src/stmf0/ao_adc_fast.c @@ -154,7 +154,7 @@ ao_adc_init(void) #endif /* Set the clock */ - stm_adc.cfgr2 = STM_ADC_CFGR2_CKMODE_PCLK_2 << STM_ADC_CFGR2_CKMODE; + stm_adc.cfgr2 = STM_ADC_CFGR2_CKMODE_ADCCLK << STM_ADC_CFGR2_CKMODE; /* Shortest sample time */ stm_adc.smpr = STM_ADC_SMPR_SMP_1_5 << STM_ADC_SMPR_SMP;