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.
This commit is contained in:
Karl Palsson
2016-10-28 17:39:38 +00:00
parent bb8f4699da
commit ed6973584c

View File

@@ -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);