git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_16.1.x@9087 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-03-13 11:39:27 +00:00
parent cfa0840672
commit c9f4d6952f
2 changed files with 16 additions and 0 deletions

View File

@ -150,6 +150,14 @@ void adc_lld_init(void) {
/* Calibration procedure.*/ /* Calibration procedure.*/
rccEnableADC1(FALSE); rccEnableADC1(FALSE);
/* CCR setup.*/
#if STM32_ADC_SUPPORTS_PRESCALER
ADC->CCR = STM32_ADC_PRESC << 18;
#else
ADC->CCR = 0;
#endif
osalDbgAssert(ADC1->CR == 0, "invalid register state"); osalDbgAssert(ADC1->CR == 0, "invalid register state");
ADC1->CR |= ADC_CR_ADCAL; ADC1->CR |= ADC_CR_ADCAL;
osalDbgAssert(ADC1->CR != 0, "invalid register state"); osalDbgAssert(ADC1->CR != 0, "invalid register state");
@ -207,6 +215,13 @@ void adc_lld_stop(ADCDriver *adcp) {
dmaStreamRelease(adcp->dmastp); dmaStreamRelease(adcp->dmastp);
/* Restoring CCR default.*/
#if STM32_ADC_SUPPORTS_PRESCALER
ADC->CCR = STM32_ADC_PRESC << 18;
#else
ADC->CCR = 0;
#endif
/* Disabling ADC.*/ /* Disabling ADC.*/
if (adcp->adc->CR & ADC_CR_ADEN) { if (adcp->adc->CR & ADC_CR_ADEN) {
adc_lld_stop_adc(adcp->adc); adc_lld_stop_adc(adcp->adc);

View File

@ -73,6 +73,7 @@
***************************************************************************** *****************************************************************************
*** 16.1.5 *** *** 16.1.5 ***
- HAL: Fixed prescaler not initialized in STM32 ADCv1 (bug #725).
- HAL: Fixed missing DAC section in STM32F072 mcuconf.h files (bug #724). - HAL: Fixed missing DAC section in STM32F072 mcuconf.h files (bug #724).
*** 16.1.4 *** *** 16.1.4 ***