diff options
Diffstat (limited to 'os/io')
-rw-r--r-- | os/io/platforms/STM32/adc_lld.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/os/io/platforms/STM32/adc_lld.c b/os/io/platforms/STM32/adc_lld.c index 567b03a2a..1aac86fe7 100644 --- a/os/io/platforms/STM32/adc_lld.c +++ b/os/io/platforms/STM32/adc_lld.c @@ -217,6 +217,9 @@ void adc_lld_start_conversion(ADCDriver *adcp) { adcp->ad_adc->SQR3 = grpp->acg_sqr3;
adcp->ad_adc->CR1 = grpp->acg_cr1 | ADC_CR1_SCAN;
adcp->ad_adc->CR2 = grpp->acg_cr2 | ADC_CR2_DMA | ADC_CR2_ADON;
+
+ /* ADC start.*/
+ adcp->ad_adc->CR2 |= ADC_CR2_SWSTART | ADC_CR2_EXTTRIG;
}
/**
@@ -226,7 +229,7 @@ void adc_lld_start_conversion(ADCDriver *adcp) { */
void adc_lld_stop_conversion(ADCDriver *adcp) {
- adcp->ad_adc->CR2 &= ~(ADC_CR2_SWSTART | ADC_CR2_EXTTRIG);
+ adcp->ad_adc->CR2 = ADC_CR2_ADON;
adcp->ad_dma->CCR = 0;
}
|