From ed6973584cce970b9323ef8a1c3ff0982f3c535e Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Fri, 28 Oct 2016 17:39:38 +0000 Subject: [PATCH] f3: adc: drop the _worst_ of the bad code The example is pointlessly complicated and includes lots of dead code, but at least remove the wasteful and confusing references to the temperature channel as pointed out on github. --- examples/stm32/f3/stm32f3-discovery/adc/adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/stm32/f3/stm32f3-discovery/adc/adc.c b/examples/stm32/f3/stm32f3-discovery/adc/adc.c index f66d811..9e73467 100644 --- a/examples/stm32/f3/stm32f3-discovery/adc/adc.c +++ b/examples/stm32/f3/stm32f3-discovery/adc/adc.c @@ -60,9 +60,7 @@ static void adc_setup(void) /* We want to read the temperature sensor, so we have to enable it. */ adc_enable_temperature_sensor(); adc_set_sample_time_on_all_channels(ADC1, ADC_SMPR_SMP_61DOT5CYC); - uint8_t channel_array[16]; - channel_array[0]=16; // Vts (Internal temperature sensor - channel_array[0]=1; //ADC1_IN1 (PA0) + uint8_t channel_array[] = { 1 }; /* ADC1_IN1 (PA0) */ adc_set_regular_sequence(ADC1, 1, channel_array); adc_set_resolution(ADC1, ADC_CFGR1_RES_12_BIT); adc_power_on(ADC1);