Skip to content

Initialize each ADC only once in Analogread #2133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Update analog.cpp
Signed-off-by: Candas1 <candascraig@hotmail.com>
  • Loading branch information
Candas1 authored Feb 18, 2024
commit 2108d325bcc1f68637d1e0fa972ba0bae9f4a30c
5 changes: 3 additions & 2 deletions libraries/SrcWrapper/src/stm32/analog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,9 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
#endif
#if !defined(STM32F1xx) && !defined(STM32F2xx) && !defined(STM32F3xx) && \
!defined(STM32F4xx) && !defined(STM32F7xx) && !defined(STM32G4xx) && \
!defined(STM32H7xx) && !defined(STM32L4xx) && !defined(STM32L5xx) && \
!defined(STM32MP1xx) && !defined(STM32WBxx) || defined(ADC_SUPPORT_2_5_MSPS)
!defined(STM32H5xx) && !defined(STM32H7xx) && !defined(STM32L4xx) && \
!defined(STM32L5xx) && !defined(STM32MP1xx) && !defined(STM32WBxx) || \
defined(ADC_SUPPORT_2_5_MSPS)
AdcHandle.Init.LowPowerAutoPowerOff = DISABLE; /* ADC automatically powers-off after a conversion and automatically wakes-up when a new conversion is triggered */
#endif
#ifdef ADC_CHANNELS_BANK_B
Expand Down