From 41e14b71b7aef2f5a3e0a616a414732767cdf725 Mon Sep 17 00:00:00 2001 From: Baker Ngan Date: Tue, 5 Dec 2017 13:44:47 -0800 Subject: [PATCH] stm32: pwr-v1: fix voltage detection logic Reviewed-by: Karl Palsson --- lib/stm32/common/pwr_common_v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stm32/common/pwr_common_v1.c b/lib/stm32/common/pwr_common_v1.c index ef3ec8f9..820dfcab 100644 --- a/lib/stm32/common/pwr_common_v1.c +++ b/lib/stm32/common/pwr_common_v1.c @@ -172,7 +172,7 @@ threshold. bool pwr_voltage_high(void) { - return PWR_CSR & PWR_CSR_PVDO; + return !(PWR_CSR & PWR_CSR_PVDO); } /*---------------------------------------------------------------------------*/