mirror of https://github.com/ARMmbed/mbed-os.git
Add more comment on the modified line
parent
2ae748910b
commit
a3baf2d7bf
|
@ -183,7 +183,12 @@ static inline uint16_t adc_read(analogin_t *obj)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADC->CCR &= ~(ADC_CCR_VBATE | ADC_CCR_TSVREFE); // Workaround
|
// Measuring VBAT sets the ADC_CCR_VBATE bit in ADC->CCR, and there is not
|
||||||
|
// possibility with the ST HAL driver to clear it. If it isn't cleared,
|
||||||
|
// VBAT remains connected to the ADC channel in preference to temperature,
|
||||||
|
// so VBAT readings are returned in place of temperature.
|
||||||
|
ADC->CCR &= ~(ADC_CCR_VBATE | ADC_CCR_TSVREFE);
|
||||||
|
|
||||||
HAL_ADC_ConfigChannel(&AdcHandle, &sConfig);
|
HAL_ADC_ConfigChannel(&AdcHandle, &sConfig);
|
||||||
|
|
||||||
HAL_ADC_Start(&AdcHandle); // Start conversion
|
HAL_ADC_Start(&AdcHandle); // Start conversion
|
||||||
|
|
Loading…
Reference in New Issue