From e2ceb77869bba148668c1389523fbeba30643433 Mon Sep 17 00:00:00 2001 From: raphaelcoeffic Date: Sun, 24 Sep 2023 20:27:43 +0200 Subject: [PATCH] Hotfix for issue with blocking ADC chain --- radio/src/targets/common/arm/stm32/stm32_adc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/radio/src/targets/common/arm/stm32/stm32_adc.cpp b/radio/src/targets/common/arm/stm32/stm32_adc.cpp index 4244a5d96a9..73c3be121b6 100644 --- a/radio/src/targets/common/arm/stm32/stm32_adc.cpp +++ b/radio/src/targets/common/arm/stm32/stm32_adc.cpp @@ -532,8 +532,10 @@ void stm32_hal_adc_wait_completion(const stm32_adc_t* ADCs, uint8_t n_ADC, (void)inputs; (void)n_inputs; + auto timeout = timersGetUsTick(); while(!_adc_completed) { // busy wait + if (timersGetUsTick() - timeout >= 300) break; } }