git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4238 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2012-05-26 13:11:31 +00:00
parent 58f95054b3
commit 6c6bc48fd6
1 changed files with 8 additions and 0 deletions

View File

@ -151,6 +151,14 @@ void adc_lld_init(void) {
disabled.*/
nvicEnableVector(ADC1_COMP_IRQn,
CORTEX_PRIORITY_MASK(STM32_ADC_IRQ_PRIORITY));
/* Calibration procedure.*/
rccEnableADC1(FALSE);
chDbgAssert(ADC1->CR == 0, "adc_lld_init(), #1", "invalid register state");
ADC1->CR |= ADC_CR_ADCAL;
while (ADC1->CR & ADC_CR_ADCAL)
;
rccDisableADC1(FALSE);
}
/**