drivers: sensor: stm32_temp: No need to calibrate ADC

The ADC should be calibrated on init, there is no requirement
to calibrate ADC again on stm32_temp_init, remove it.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2022-03-22 12:24:42 +08:00 committed by Carles Cufí
commit 94624dc0c5

View file

@ -61,7 +61,6 @@ static int stm32_temp_sample_fetch(const struct device *dev, enum sensor_channel
k_mutex_lock(&data->mutex, K_FOREVER); k_mutex_lock(&data->mutex, K_FOREVER);
rc = adc_read(data->adc, sp); rc = adc_read(data->adc, sp);
sp->calibrate = false;
if (rc == 0) { if (rc == 0) {
data->raw = data->sample_buffer; data->raw = data->sample_buffer;
} }
@ -135,7 +134,6 @@ static int stm32_temp_init(const struct device *dev)
.buffer = &data->sample_buffer, .buffer = &data->sample_buffer,
.buffer_size = sizeof(data->sample_buffer), .buffer_size = sizeof(data->sample_buffer),
.resolution = 12, .resolution = 12,
.calibrate = true,
}; };
return 0; return 0;