some more bugfixes
This commit is contained in:
@ -116,11 +116,11 @@ ReturnValue_t GyrL3gCustomHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
if (internalState == InternalState::STARTUP) {
|
||||
commandExecuted = true;
|
||||
}
|
||||
PoolReadGuard readSet(&dataset);
|
||||
PoolReadGuard pg(&dataset);
|
||||
dataset.setValidity(true, true);
|
||||
dataset.angVelocX = reply->angVelocities[0];
|
||||
dataset.angVelocY = reply->angVelocities[1];
|
||||
dataset.angVelocZ = reply->angVelocities[2];
|
||||
dataset.angVelocX = static_cast<float>(reply->angVelocities[0]) * reply->sensitivity;
|
||||
dataset.angVelocY = static_cast<float>(reply->angVelocities[1]) * reply->sensitivity;
|
||||
dataset.angVelocZ = static_cast<float>(reply->angVelocities[2]) * reply->sensitivity;
|
||||
if (std::abs(dataset.angVelocX.value) > absLimitX) {
|
||||
dataset.angVelocX.setValid(false);
|
||||
}
|
||||
@ -132,34 +132,6 @@ ReturnValue_t GyrL3gCustomHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
}
|
||||
dataset.temperature = 25.0 - reply->tempOffsetRaw;
|
||||
}
|
||||
// PoolReadGuard readSet(&dataset);
|
||||
// if (readSet.getReadResult() == returnvalue::OK) {
|
||||
// if (std::abs(angVelocX) < this->absLimitX) {
|
||||
// dataset.angVelocX = angVelocX;
|
||||
// dataset.angVelocX.setValid(true);
|
||||
// } else {
|
||||
// dataset.angVelocX.setValid(false);
|
||||
// }
|
||||
//
|
||||
// if (std::abs(angVelocY) < this->absLimitY) {
|
||||
// dataset.angVelocY = angVelocY;
|
||||
// dataset.angVelocY.setValid(true);
|
||||
// } else {
|
||||
// dataset.angVelocY.setValid(false);
|
||||
// }
|
||||
//
|
||||
// if (std::abs(angVelocZ) < this->absLimitZ) {
|
||||
// dataset.angVelocZ = angVelocZ;
|
||||
// dataset.angVelocZ.setValid(true);
|
||||
// } else {
|
||||
// dataset.angVelocZ.setValid(false);
|
||||
// }
|
||||
//
|
||||
// dataset.temperature = temperature;
|
||||
// dataset.temperature.setValid(true);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@ -183,9 +155,6 @@ ReturnValue_t GyrL3gCustomHandler::initializeLocalDataPool(localpool::DataPool &
|
||||
void GyrL3gCustomHandler::fillCommandAndReplyMap() {
|
||||
insertInCommandMap(l3gd20h::REQUEST);
|
||||
insertInReplyMap(l3gd20h::REPLY, 5, nullptr, 0, true);
|
||||
// insertInCommandAndReplyMap(l3gd20h::READ_REGS, 1, &dataset);
|
||||
// insertInCommandAndReplyMap(l3gd20h::CONFIGURE_CTRL_REGS, 1);
|
||||
// insertInCommandAndReplyMap(l3gd20h::READ_CTRL_REGS, 1);
|
||||
}
|
||||
|
||||
void GyrL3gCustomHandler::modeChanged() { internalState = InternalState::NONE; }
|
||||
|
Reference in New Issue
Block a user