diff --git a/ports/stm32f4/common-hal/analogio/AnalogIn.c b/ports/stm32f4/common-hal/analogio/AnalogIn.c index f4cf022d13..3ee3c4dbbb 100644 --- a/ports/stm32f4/common-hal/analogio/AnalogIn.c +++ b/ports/stm32f4/common-hal/analogio/AnalogIn.c @@ -119,27 +119,6 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { HAL_ADC_PollForConversion(&AdcHandle,1); uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle); HAL_ADC_Stop(&AdcHandle); - - //LL Implementation - // if (LL_ADC_IsEnabled(ADCx) == 0) - // { - // LL_ADC_REG_SetTriggerSource(ADCx, LL_ADC_REG_TRIG_SOFTWARE); - // LL_ADC_REG_SetContinuousMode(ADCx, LL_ADC_REG_CONV_SINGLE); - // LL_ADC_REG_SetSequencerLength(ADCx, LL_ADC_REG_SEQ_SCAN_DISABLE); - // //LL_ADC_REG_SetSequencerRanks(ADCx, LL_ADC_REG_RANK_1, self->pin->adc_channel); - // //^ Above is WRONG: channel value requires inserted channel information. Hard to iterate through. - // LL_ADC_REG_SetSequencerRanks(ADC1, LL_ADC_REG_RANK_1, LL_ADC_CHANNEL_4); - - // LL_ADC_SetChannelSamplingTime(ADCx, self->pin->adc_channel, LL_ADC_SAMPLINGTIME_56CYCLES); - // LL_ADC_EnableIT_OVR(ADCx); - // } - // LL_ADC_Enable(ADCx); - // uint16_t uhADCxConvertedData = (__LL_ADC_DIGITAL_SCALE(LL_ADC_RESOLUTION_12B) + 1); - // LL_ADC_REG_StartConversionSWStart(ADCx); - // while (LL_ADC_IsActiveFlag_EOCS(ADCx) == 0) {} - // /* Retrieve ADC conversion data */ - // /* (data scale corresponds to ADC resolution: 12 bits) */ - // uhADCxConvertedData = LL_ADC_REG_ReadConversionData12(ADCx); // // Shift the value to be 16 bit. return value << 4;