git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9088 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-03-13 11:39:44 +00:00
parent 8464f9100e
commit e0ed67de6b
2 changed files with 17 additions and 0 deletions

View File

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

View File

@ -96,6 +96,8 @@
- RT: Merged RT4.
- NIL: Merged NIL2.
- NIL: Added STM32F7 demo.
- HAL: Fixed prescaler not initialized in STM32 ADCv1 (bug #725)
(backported to 16.1.5).
- HAL: Fixed missing DAC section in STM32F072 mcuconf.h files (bug #724)
(backported to 16.1.5).
- VAR: Fixed palSetMode glitching outputs (bug #723)(backported to 3.0.6