machine/stm32f1, stm32f4: fix ADC by clearing the correct bit for rank after each read

Signed-off-by: deadprogram <ron@hybridgroup.com>
Этот коммит содержится в:
deadprogram 2022-11-20 20:48:55 +01:00 коммит произвёл Ron Evans
родитель a7fc65861d
коммит 217449df07
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -75,7 +75,7 @@ func (a ADC) Get() uint16 {
stm32.ADC1.SR.ClearBits(stm32.ADC_SR_EOC) stm32.ADC1.SR.ClearBits(stm32.ADC_SR_EOC)
// clear rank // clear rank
stm32.ADC1.SMPR1.ClearBits(ch) stm32.ADC1.SQR3.ClearBits(ch)
return result return result
} }

Просмотреть файл

@ -70,7 +70,7 @@ func (a ADC) Get() uint16 {
stm32.ADC1.SR.ClearBits(stm32.ADC_SR_EOC) stm32.ADC1.SR.ClearBits(stm32.ADC_SR_EOC)
// clear rank // clear rank
stm32.ADC1.SMPR1.ClearBits(ch) stm32.ADC1.SQR3.ClearBits(ch)
return result return result
} }