updated the lisa_m_2 (STM32 F1) ADC examples for recent code changes to stm32f1 adc.c and adc.h
This commit is contained in:
@@ -114,13 +114,13 @@ void adc_setup(void)
|
||||
/* We want to start the injected conversion with the TIM2 TRGO */
|
||||
adc_enable_external_trigger_injected(ADC1,ADC_CR2_JEXTSEL_TIM2_TRGO);
|
||||
/* Generate the ADC1_2_IRQ */
|
||||
adc_enable_jeoc_interrupt(ADC1);
|
||||
adc_enable_eoc_interrupt_injected(ADC1);
|
||||
adc_set_right_aligned(ADC1);
|
||||
/* We want to read the temperature sensor, so we have to enable it. */
|
||||
adc_enable_temperature_sensor(ADC1);
|
||||
adc_set_conversion_time_on_all_channels(ADC1, ADC_SMPR_SMP_28DOT5CYC);
|
||||
adc_set_sample_time_on_all_channels(ADC1, ADC_SMPR_SMP_28DOT5CYC);
|
||||
|
||||
adc_on(ADC1);
|
||||
adc_power_on(ADC1);
|
||||
|
||||
/* Wait for ADC starting up. */
|
||||
for (i = 0; i < 800000; i++) /* Wait a bit. */
|
||||
@@ -207,5 +207,5 @@ void adc1_2_isr(void)
|
||||
{
|
||||
/* Clear Injected End Of Conversion (JEOC) */
|
||||
ADC_SR(ADC1) &= ~ADC_SR_JEOC;
|
||||
temperature = ADC_JDR1(ADC1);
|
||||
temperature = adc_read_injected(ADC1,1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user