提交 f6b5d183 编写于 作者: Y yn386 提交者: Damien George

stm32/adc: Fix ADCAll.read_core_temp() on L4 MCUs.

TS_CAL1 and TS_CAL2 of STM32L4 are at VDDA=3.0V, so the reference
correction factor should be updated before reading tempsensor.
上级 2154ee21
......@@ -860,9 +860,9 @@ float adc_read_core_temp_float(ADC_HandleTypeDef *adcHandle) {
return 0;
}
#else
#if defined(STM32L1)
#if defined(STM32L1) || defined(STM32L4)
// Update the reference correction factor before reading tempsensor
// because TS_CAL1 and TS_CAL2 of STM32L1 are at VDDA=3.0V
// because TS_CAL1 and TS_CAL2 of STM32L1/L4 are at VDDA=3.0V
adc_read_core_vref(adcHandle);
#endif
int32_t raw_value = adc_config_and_read_ref(adcHandle, ADC_CHANNEL_TEMPSENSOR);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册