applied clang format
This commit is contained in:
@ -8,8 +8,7 @@ GyroHandlerL3GD20H::GyroHandlerL3GD20H(object_id_t objectId, object_id_t deviceC
|
||||
CookieIF *comCookie, uint32_t transitionDelayMs)
|
||||
: DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
||||
transitionDelayMs(transitionDelayMs),
|
||||
dataset(this) {
|
||||
}
|
||||
dataset(this) {}
|
||||
|
||||
GyroHandlerL3GD20H::~GyroHandlerL3GD20H() {}
|
||||
|
||||
@ -190,24 +189,23 @@ ReturnValue_t GyroHandlerL3GD20H::interpretDeviceReply(DeviceCommandId_t id,
|
||||
|
||||
int8_t temperaturOffset = (-1) * packet[L3GD20H::TEMPERATURE_IDX];
|
||||
float temperature = 25.0 + temperaturOffset;
|
||||
if(periodicPrintout) {
|
||||
if (periodicPrintout) {
|
||||
if (debugDivider.checkAndIncrement()) {
|
||||
/* Set terminal to utf-8 if there is an issue with micro printout. */
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "GyroHandlerL3GD20H: Angular velocities (deg/s):" << std::endl;
|
||||
sif::info << "X: " << angVelocX << std::endl;
|
||||
sif::info << "Y: " << angVelocY << std::endl;
|
||||
sif::info << "Z: " << angVelocZ << std::endl;
|
||||
#else
|
||||
#else
|
||||
sif::printInfo("GyroHandlerL3GD20H: Angular velocities (deg/s):\n");
|
||||
sif::printInfo("X: %f\n", angVelocX);
|
||||
sif::printInfo("Y: %f\n", angVelocY);
|
||||
sif::printInfo("Z: %f\n", angVelocZ);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PoolReadGuard readSet(&dataset);
|
||||
if (readSet.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
|
||||
if (std::abs(angVelocX) < this->absLimitX) {
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef MISSION_DEVICES_GYROL3GD20HANDLER_H_
|
||||
#define MISSION_DEVICES_GYROL3GD20HANDLER_H_
|
||||
|
||||
#include "devicedefinitions/GyroL3GD20Definitions.h"
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
||||
|
||||
#include "devicedefinitions/GyroL3GD20Definitions.h"
|
||||
|
||||
/**
|
||||
* @brief Device Handler for the L3GD20H gyroscope sensor
|
||||
* (https://www.st.com/en/mems-and-sensors/l3gd20h.html)
|
||||
@ -59,7 +59,6 @@ class GyroHandlerL3GD20H : public DeviceHandlerBase {
|
||||
uint32_t transitionDelayMs = 0;
|
||||
GyroPrimaryDataset dataset;
|
||||
|
||||
|
||||
float absLimitX = L3GD20H::RANGE_DPS_00;
|
||||
float absLimitY = L3GD20H::RANGE_DPS_00;
|
||||
float absLimitZ = L3GD20H::RANGE_DPS_00;
|
||||
|
@ -269,25 +269,24 @@ ReturnValue_t MgmLIS3MDLHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
float mgmZ = static_cast<float>(mgmMeasurementRawZ) * sensitivityFactor *
|
||||
MGMLIS3MDL::GAUSS_TO_MICROTESLA_FACTOR;
|
||||
|
||||
if(periodicPrintout) {
|
||||
if (periodicPrintout) {
|
||||
if (debugDivider.checkAndIncrement()) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "MGMHandlerLIS3: Magnetic field strength in"
|
||||
" microtesla:"
|
||||
<< std::endl;
|
||||
sif::info << "X: " << mgmX << " uT" << std::endl;
|
||||
sif::info << "Y: " << mgmY << " uT" << std::endl;
|
||||
sif::info << "Z: " << mgmZ << " uT" << std::endl;
|
||||
#else
|
||||
#else
|
||||
sif::printInfo("MGMHandlerLIS3: Magnetic field strength in microtesla:\n");
|
||||
sif::printInfo("X: %f uT\n", mgmX);
|
||||
sif::printInfo("Y: %f uT\n", mgmY);
|
||||
sif::printInfo("Z: %f uT\n", mgmZ);
|
||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 0 */
|
||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 0 */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PoolReadGuard readHelper(&dataset);
|
||||
if (readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
|
||||
if (std::abs(mgmX) < absLimitX) {
|
||||
@ -317,13 +316,13 @@ ReturnValue_t MgmLIS3MDLHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
case MGMLIS3MDL::READ_TEMPERATURE: {
|
||||
int16_t tempValueRaw = packet[2] << 8 | packet[1];
|
||||
float tempValue = 25.0 + ((static_cast<float>(tempValueRaw)) / 8.0);
|
||||
if(periodicPrintout) {
|
||||
if (periodicPrintout) {
|
||||
if (debugDivider.check()) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "MGMHandlerLIS3: Temperature: " << tempValue << " C" << std::endl;
|
||||
#else
|
||||
#else
|
||||
sif::printInfo("MGMHandlerLIS3: Temperature: %f C\n");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -485,7 +484,6 @@ void MgmLIS3MDLHandler::setAbsoluteLimits(float xLimit, float yLimit, float zLim
|
||||
this->absLimitZ = zLimit;
|
||||
}
|
||||
|
||||
|
||||
void MgmLIS3MDLHandler::enablePeriodicPrintouts(bool enable, uint8_t divider) {
|
||||
periodicPrintout = enable;
|
||||
debugDivider.setDivider(divider);
|
||||
|
@ -1,11 +1,10 @@
|
||||
#ifndef MISSION_DEVICES_MGMLIS3MDLHANDLER_H_
|
||||
#define MISSION_DEVICES_MGMLIS3MDLHANDLER_H_
|
||||
|
||||
|
||||
#include "devicedefinitions/MgmLIS3HandlerDefs.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "fsfw/globalfunctions/PeriodicOperationDivider.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "fsfw/globalfunctions/PeriodicOperationDivider.h"
|
||||
|
||||
class PeriodicOperationDivider;
|
||||
|
||||
|
@ -10,8 +10,7 @@ MgmRM3100Handler::MgmRM3100Handler(object_id_t objectId, object_id_t deviceCommu
|
||||
CookieIF *comCookie, uint32_t transitionDelay)
|
||||
: DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
||||
primaryDataset(this),
|
||||
transitionDelay(transitionDelay) {
|
||||
}
|
||||
transitionDelay(transitionDelay) {}
|
||||
|
||||
MgmRM3100Handler::~MgmRM3100Handler() {}
|
||||
|
||||
@ -334,25 +333,24 @@ ReturnValue_t MgmRM3100Handler::handleDataReadout(const uint8_t *packet) {
|
||||
float fieldStrengthY = fieldStrengthRawY * scaleFactorX;
|
||||
float fieldStrengthZ = fieldStrengthRawZ * scaleFactorX;
|
||||
|
||||
if(periodicPrintout) {
|
||||
if (periodicPrintout) {
|
||||
if (debugDivider.checkAndIncrement()) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "MgmRM3100Handler: Magnetic field strength in"
|
||||
" microtesla:"
|
||||
<< std::endl;
|
||||
sif::info << "X: " << fieldStrengthX << " uT" << std::endl;
|
||||
sif::info << "Y: " << fieldStrengthY << " uT" << std::endl;
|
||||
sif::info << "Z: " << fieldStrengthZ << " uT" << std::endl;
|
||||
#else
|
||||
#else
|
||||
sif::printInfo("MgmRM3100Handler: Magnetic field strength in microtesla:\n");
|
||||
sif::printInfo("X: %f uT\n", fieldStrengthX);
|
||||
sif::printInfo("Y: %f uT\n", fieldStrengthY);
|
||||
sif::printInfo("Z: %f uT\n", fieldStrengthZ);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO: Sanity check on values?
|
||||
PoolReadGuard readGuard(&primaryDataset);
|
||||
if (readGuard.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
|
||||
|
Reference in New Issue
Block a user