This commit is contained in:
Robin Müller 2020-12-29 01:15:35 +01:00
parent c1e9604977
commit e2d7905334
2 changed files with 5 additions and 5 deletions

View File

@ -171,11 +171,11 @@ ReturnValue_t GyroHandler::interpretDeviceReply(DeviceCommandId_t id,
int8_t temperaturOffset = (-1) * packet[L3GD20H::TEMPERATURE_IDX]; int8_t temperaturOffset = (-1) * packet[L3GD20H::TEMPERATURE_IDX];
float temperature = 25.0 + temperaturOffset; float temperature = 25.0 + temperaturOffset;
ReturnValue_t result = dataset.read(20); result = dataset.read(20);
if(result == HasReturnvaluesIF::RETURN_OK) { if(result == HasReturnvaluesIF::RETURN_OK) {
dataset.angVelocX = angVelocX; dataset.angVelocX = angVelocX;
dataset.angVelocY = angVelocX; dataset.angVelocY = angVelocY;
dataset.angVelocZ = angVelocX; dataset.angVelocZ = angVelocZ;
dataset.temperature = temperature; dataset.temperature = temperature;
dataset.setValidity(true, true); dataset.setValidity(true, true);
result = dataset.commit(20); result = dataset.commit(20);

View File

@ -14,7 +14,7 @@ static constexpr uint8_t WHO_AM_I_REG = 0b0000'1111;
static constexpr uint8_t WHO_AM_I_VAL = 0b1101'0111; 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_1 = 0b0010'0000;
static constexpr uint8_t CTRL_REG_2 = 0b0010'0001; 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; 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 READ_REGS = 0;
static constexpr DeviceCommandId_t CONFIGURE_CTRL_REGS = 1; static constexpr DeviceCommandId_t CONFIGURE_CTRL_REGS = 1;