Skip to content

Commit 4824e18

Browse files
committed
STM32L4: add ADC calibration
1 parent 6a46b9c commit 4824e18

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

targets/TARGET_STM/TARGET_STM32L4/analogin_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ void analogin_init(analogin_t *obj, PinName pin)
9696
if (HAL_ADC_Init(&obj->handle) != HAL_OK) {
9797
error("Cannot initialize ADC\n");
9898
}
99+
100+
// Calibrate ADC
101+
HAL_ADCEx_Calibration_Start(&obj->handle, ADC_SINGLE_ENDED);
99102
}
100103
}
101104

0 commit comments

Comments
 (0)