From a817f43ae9ae5db6a900d1ce3ffecc5f25aa2610 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 29 Dec 2020 01:15:35 +0100 Subject: [PATCH] bugfix --- mission/devices/GyroL3GD20Handler.cpp | 6 +++--- mission/devices/devicedefinitions/GyroL3GD20Definitions.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mission/devices/GyroL3GD20Handler.cpp b/mission/devices/GyroL3GD20Handler.cpp index b6067e5b..11a053c8 100644 --- a/mission/devices/GyroL3GD20Handler.cpp +++ b/mission/devices/GyroL3GD20Handler.cpp @@ -171,11 +171,11 @@ ReturnValue_t GyroHandler::interpretDeviceReply(DeviceCommandId_t id, int8_t temperaturOffset = (-1) * packet[L3GD20H::TEMPERATURE_IDX]; float temperature = 25.0 + temperaturOffset; - ReturnValue_t result = dataset.read(20); + result = dataset.read(20); if(result == HasReturnvaluesIF::RETURN_OK) { dataset.angVelocX = angVelocX; - dataset.angVelocY = angVelocX; - dataset.angVelocZ = angVelocX; + dataset.angVelocY = angVelocY; + dataset.angVelocZ = angVelocZ; dataset.temperature = temperature; dataset.setValidity(true, true); result = dataset.commit(20); diff --git a/mission/devices/devicedefinitions/GyroL3GD20Definitions.h b/mission/devices/devicedefinitions/GyroL3GD20Definitions.h index c6042f58..d2fa9903 100644 --- a/mission/devices/devicedefinitions/GyroL3GD20Definitions.h +++ b/mission/devices/devicedefinitions/GyroL3GD20Definitions.h @@ -14,7 +14,7 @@ static constexpr uint8_t WHO_AM_I_REG = 0b0000'1111; static constexpr uint8_t WHO_AM_I_VAL = 0b1101'0111; /*------------------------------------------------------------------------*/ -/* Control registers +/* Control registers */ /*------------------------------------------------------------------------*/ static constexpr uint8_t CTRL_REG_1 = 0b0010'0000; static constexpr uint8_t CTRL_REG_2 = 0b0010'0001; @@ -88,7 +88,7 @@ static constexpr uint8_t OUT_Z_L = 13; static constexpr uint8_t OUT_Z_H = 14; /*------------------------------------------------------------------------*/ -/* Device Handler specific +/* Device Handler specific */ /*------------------------------------------------------------------------*/ static constexpr DeviceCommandId_t READ_REGS = 0; static constexpr DeviceCommandId_t CONFIGURE_CTRL_REGS = 1;