Skip to content

Commit 5e6f78f

Browse files
committed
#266 EOC flag clear after every read
1 parent 75b6710 commit 5e6f78f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib/stm32/stm32l0/CatenaStm32L0_ReadAnalog.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ bool McciCatena::CatenaStm32L0_ReadAnalog(
172172
*pValue = 5;
173173
if (Channel != STM32L0_ADC_CHANNEL_VREFINT)
174174
{
175-
AdcStart();
176175
fStatusOk = AdcGetValue(&vChannel);
177176
}
178177
else
@@ -384,7 +383,7 @@ static bool AdcGetValue(uint32_t *value)
384383
if (rAdcIsr & ADC_ISR_EOC)
385384
{
386385
*value = ADC1->DR;
387-
ADC1->ISR = ADC_ISR_EOC;
386+
ADC1->ISR &= ~ADC_ISR_EOC;
388387
return true;
389388
}
390389

0 commit comments

Comments
 (0)