From 42983e279041fdd0ae9274c87a2e91fb9bb7dfa6 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 29 Jul 2015 13:18:26 +0000 Subject: [PATCH] stm32f3: adc: Overrun flag is cleared by writing 1 Unlike the ADC peripheral on most other stm32 parts, the bits in the ADC_ISR register are r_w1, not rc_w0. Fixes github bug: #493 --- lib/stm32/f3/adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/stm32/f3/adc.c b/lib/stm32/f3/adc.c index 3a4d3869..ae4210c8 100644 --- a/lib/stm32/f3/adc.c +++ b/lib/stm32/f3/adc.c @@ -1026,8 +1026,8 @@ bool adc_get_overrun_flag(uint32_t adc) void adc_clear_overrun_flag(uint32_t adc) { -/* need to write zero to clear this */ - ADC_ISR(adc) &= ~ADC_ISR_OVR; + /* r_w1 bit */ + ADC_ISR(adc) |= ADC_ISR_OVR; } /*---------------------------------------------------------------------------*/