From 1f63e9b701aa6398ddb2e0db5e3a0f7f5adb4fcf Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 20 May 2019 14:37:28 +1000 Subject: [PATCH] stm32/adc: Fix VBAT_DIV to be 4 for STM32F411. Fixes issue #4794. --- ports/stm32/adc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ports/stm32/adc.c b/ports/stm32/adc.c index 4f92324562..46fbbe7364 100644 --- a/ports/stm32/adc.c +++ b/ports/stm32/adc.c @@ -131,14 +131,15 @@ #if defined(STM32F091xC) #define VBAT_DIV (2) #elif defined(STM32F405xx) || defined(STM32F415xx) || \ - defined(STM32F407xx) || defined(STM32F417xx) || \ - defined(STM32F401xC) || defined(STM32F401xE) || \ - defined(STM32F411xE) + defined(STM32F407xx) || defined(STM32F417xx) || \ + defined(STM32F401xC) || defined(STM32F401xE) #define VBAT_DIV (2) -#elif defined(STM32F427xx) || defined(STM32F429xx) || \ +#elif defined(STM32F411xE) || defined(STM32F413xx) || \ + defined(STM32F427xx) || defined(STM32F429xx) || \ defined(STM32F437xx) || defined(STM32F439xx) || \ - defined(STM32F446xx) || defined(STM32F413xx) || \ - defined(STM32F722xx) || defined(STM32F723xx) || \ + defined(STM32F446xx) +#define VBAT_DIV (4) +#elif defined(STM32F722xx) || defined(STM32F723xx) || \ defined(STM32F732xx) || defined(STM32F733xx) || \ defined(STM32F746xx) || defined(STM32F765xx) || \ defined(STM32F767xx) || defined(STM32F769xx)