diff options
author | deadprogram <[email protected]> | 2022-11-20 20:48:55 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-11-21 08:53:21 +0100 |
commit | 217449df07923bc6d867b7894f974f934269e733 (patch) | |
tree | 7541f35520b02ad273a5ad5d701697169744c53a /src | |
parent | a7fc65861dc530e5503a640282e52a286f8b9342 (diff) | |
download | tinygo-217449df07923bc6d867b7894f974f934269e733.tar.gz tinygo-217449df07923bc6d867b7894f974f934269e733.zip |
machine/stm32f1, stm32f4: fix ADC by clearing the correct bit for rank after each read
Signed-off-by: deadprogram <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/machine/machine_stm32_adc_f1.go | 2 | ||||
-rw-r--r-- | src/machine/machine_stm32_adc_f4.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/machine/machine_stm32_adc_f1.go b/src/machine/machine_stm32_adc_f1.go index fb0cee669..e2c82f623 100644 --- a/src/machine/machine_stm32_adc_f1.go +++ b/src/machine/machine_stm32_adc_f1.go @@ -75,7 +75,7 @@ func (a ADC) Get() uint16 { stm32.ADC1.SR.ClearBits(stm32.ADC_SR_EOC) // clear rank - stm32.ADC1.SMPR1.ClearBits(ch) + stm32.ADC1.SQR3.ClearBits(ch) return result } diff --git a/src/machine/machine_stm32_adc_f4.go b/src/machine/machine_stm32_adc_f4.go index 4f0b8d11b..3a163ffda 100644 --- a/src/machine/machine_stm32_adc_f4.go +++ b/src/machine/machine_stm32_adc_f4.go @@ -70,7 +70,7 @@ func (a ADC) Get() uint16 { stm32.ADC1.SR.ClearBits(stm32.ADC_SR_EOC) // clear rank - stm32.ADC1.SMPR1.ClearBits(ch) + stm32.ADC1.SQR3.ClearBits(ch) return result } |