Skip to content

Commit 3299a73

Browse files
committed
Missing ADC calibration for STM32F0
Fix #30 Signed-off-by: Frederic.Pillon <[email protected]>
1 parent dbf50f7 commit 3299a73

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: cores/arduino/stm32/analog.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,13 @@ uint16_t adc_read_value(PinName pin)
604604
return 0;
605605
}
606606

607-
#if defined (STM32F3xx) || defined (STM32L4xx)
607+
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32L4xx)
608608
/*##-2.1- Calibrate ADC then Start the conversion process ####################*/
609+
#if defined (STM32F0xx)
610+
if (HAL_ADCEx_Calibration_Start(&AdcHandle) != HAL_OK)
611+
#else
609612
if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_SINGLE_ENDED) != HAL_OK)
613+
#endif
610614
{
611615
/* ADC Calibration Error */
612616
return 0;

0 commit comments

Comments
 (0)