git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13881 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2020-10-10 10:16:58 +00:00
parent a544fee35f
commit 4c808b1f2c
2 changed files with 10 additions and 0 deletions

View File

@ -171,12 +171,16 @@ static void adc_lld_calibrate(ADCDriver *adcp) {
while ((adcp->adcm->CR & ADC_CR_ADCAL) != 0)
;
osalSysPolledDelayX(OSAL_US2RTC(STM32_HCLK, 20));
/* Single-ended calibration for master ADC.*/
adcp->adcm->CR = ADC_CR_ADVREGEN;
adcp->adcm->CR = ADC_CR_ADVREGEN | ADC_CR_ADCAL;
while ((adcp->adcm->CR & ADC_CR_ADCAL) != 0)
;
osalSysPolledDelayX(OSAL_US2RTC(STM32_HCLK, 20));
#if STM32_ADC_DUAL_MODE
osalDbgAssert(adcp->adcs->CR == ADC_CR_ADVREGEN, "invalid register state");
@ -186,11 +190,15 @@ static void adc_lld_calibrate(ADCDriver *adcp) {
while ((adcp->adcs->CR & ADC_CR_ADCAL) != 0)
;
osalSysPolledDelayX(OSAL_US2RTC(STM32_HCLK, 20));
/* Single-ended calibration for slave ADC.*/
adcp->adcs->CR = ADC_CR_ADVREGEN;
adcp->adcs->CR = ADC_CR_ADVREGEN | ADC_CR_ADCAL;
while ((adcp->adcs->CR & ADC_CR_ADCAL) != 0)
;
osalSysPolledDelayX(OSAL_US2RTC(STM32_HCLK, 20));
#endif
}

View File

@ -119,6 +119,8 @@
MEMS Accelerometers.
- NEW: Safer messages mechanism for sandboxes (to be backported to 20.3.1).
- NEW: Added latency measurement test application.
- FIX: Fixed STM32 ADCv3 hangin on initialization (bug #1126)
(backported to 20.3.3)(backported to 19.1.5).
- FIX: Fixed I2S-related problems in STM32F4xx registry (bug #1124)
(backported to 20.3.3)(backported to 19.1.5).
- FIX: Fixed STM32 EXTIv1 driver unable to enable/disable fixed lines