From ee09497b6479dd8ea1bc253693fcd9162dd435a6 Mon Sep 17 00:00:00 2001
From: Peter Barker <pbarker@barker.dropbear.id.au>
Date: Thu, 14 Nov 2024 17:52:40 +1100
Subject: [PATCH] AP_HAL_ChibiOS: correct logging of MAV_POWER_STATUS_CHANGED

need to exclude the changed flag from the comparison!
---
 libraries/AP_HAL_ChibiOS/AnalogIn.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/AP_HAL_ChibiOS/AnalogIn.cpp b/libraries/AP_HAL_ChibiOS/AnalogIn.cpp
index 13a06048b1..b388e5cf77 100644
--- a/libraries/AP_HAL_ChibiOS/AnalogIn.cpp
+++ b/libraries/AP_HAL_ChibiOS/AnalogIn.cpp
@@ -894,7 +894,7 @@ void AnalogIn::update_power_flags(void)
 #endif
 
     if (_power_flags != 0 &&
-        _power_flags != flags &&
+        (_power_flags&~MAV_POWER_STATUS_CHANGED) != (flags&~MAV_POWER_STATUS_CHANGED) &&
         hal.util->get_soft_armed()) {
         // the power status has changed while armed
         flags |= MAV_POWER_STATUS_CHANGED;