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:
@@ -60,9 +60,7 @@ static void adc_setup(void)
|
|||||||
/* We want to read the temperature sensor, so we have to enable it. */
|
/* We want to read the temperature sensor, so we have to enable it. */
|
||||||
adc_enable_temperature_sensor();
|
adc_enable_temperature_sensor();
|
||||||
adc_set_sample_time_on_all_channels(ADC1, ADC_SMPR_SMP_61DOT5CYC);
|
adc_set_sample_time_on_all_channels(ADC1, ADC_SMPR_SMP_61DOT5CYC);
|
||||||
uint8_t channel_array[16];
|
uint8_t channel_array[] = { 1 }; /* ADC1_IN1 (PA0) */
|
||||||
channel_array[0]=16; // Vts (Internal temperature sensor
|
|
||||||
channel_array[0]=1; //ADC1_IN1 (PA0)
|
|
||||||
adc_set_regular_sequence(ADC1, 1, channel_array);
|
adc_set_regular_sequence(ADC1, 1, channel_array);
|
||||||
adc_set_resolution(ADC1, ADC_CFGR1_RES_12_BIT);
|
adc_set_resolution(ADC1, ADC_CFGR1_RES_12_BIT);
|
||||||
adc_power_on(ADC1);
|
adc_power_on(ADC1);
|
||||||
|
|||||||
Reference in New Issue
Block a user