From d17ec02cf04e8d33359a612abdfdcbfbbc7d5bfb Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 2 Feb 2023 18:26:08 +0100 Subject: [PATCH 1/2] fixed Z value calculation --- src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp b/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp index aa7c22d4..4becd420 100644 --- a/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp +++ b/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp @@ -325,7 +325,7 @@ ReturnValue_t MgmRM3100Handler::handleDataReadout(const uint8_t *packet) { // trickery here to calculate the raw values first int32_t fieldStrengthRawX = ((packet[1] << 24) | (packet[2] << 16) | (packet[3] << 8)) >> 8; int32_t fieldStrengthRawY = ((packet[4] << 24) | (packet[5] << 16) | (packet[6] << 8)) >> 8; - int32_t fieldStrengthRawZ = ((packet[7] << 24) | (packet[8] << 16) | (packet[3] << 8)) >> 8; + int32_t fieldStrengthRawZ = ((packet[7] << 24) | (packet[8] << 16) | (packet[9] << 8)) >> 8; // Now scale to physical value in microtesla float fieldStrengthX = fieldStrengthRawX * scaleFactorX; -- 2.43.0 From acfc1cbf219702d646499aa1e9c366f2285f73fe Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 2 Feb 2023 18:31:40 +0100 Subject: [PATCH 2/2] bump changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0a0055d..753a267a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). # [unreleased] +## Fixes + +- Bugfix for RM3100 MGM sensors. Z value was previously calculated + with bytes of the X value. + # [v6.0.0] ## Fixes -- 2.43.0