From 957da68da5f4ed1839ac2eb78f1f5999c709880c Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Wed, 15 Dec 2021 09:29:26 +1100 Subject: [PATCH] AP_Compass: fix compilation issue with declaring var after goto --- libraries/AP_Compass/AP_Compass_RM3100.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Compass/AP_Compass_RM3100.cpp b/libraries/AP_Compass/AP_Compass_RM3100.cpp index 4b2ef49fc6..f3423c1348 100644 --- a/libraries/AP_Compass/AP_Compass_RM3100.cpp +++ b/libraries/AP_Compass/AP_Compass_RM3100.cpp @@ -212,14 +212,13 @@ void AP_Compass_RM3100::timer() // some RM3100 builds get the polarity wrong on one or more of the // elements. By setting AP_RM3100_REVERSAL_MASK in hwdef.dat you // can fix it without modifying the hardware - const uint8_t mask = AP_RM3100_REVERSAL_MASK; - if (mask & 1U) { + if (AP_RM3100_REVERSAL_MASK & 1U) { magx = -magx; } - if (mask & 2U) { + if (AP_RM3100_REVERSAL_MASK & 2U) { magy = -magy; } - if (mask & 4U) { + if (AP_RM3100_REVERSAL_MASK & 4U) { magz = -magz; } #endif