altos/stmf0: Switch ADC fast to ADC clock
authorKeith Packard <keithp@keithp.com>
Tue, 9 Aug 2016 05:39:16 +0000 (22:39 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 9 Aug 2016 05:39:16 +0000 (22:39 -0700)
Using this slower clock eliminates sampling problems with the ADC and
cleans up the chaoskey raw data.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stmf0/ao_adc_fast.c

index fbf4ad2e88527e2d5e8d88c0d47924e52ff81d95..5ce3a396e5a0c538fc8f2f3a67e8b2e6afbcd515 100644 (file)
@@ -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;