Skip to content

Commit 5369fc5

Browse files
committed
chore(tidy): clang format
1 parent 01763c5 commit 5369fc5

File tree

4 files changed

+41
-23
lines changed

4 files changed

+41
-23
lines changed

src/components/i2c/drivers/drvBase.h

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ class drvBase {
447447
@returns True if the sensor value was obtained successfully, False
448448
otherwise.
449449
*/
450-
virtual bool getEventMagneticField(sensors_event_t *magneticEvent) { return false; }
450+
virtual bool getEventMagneticField(sensors_event_t *magneticEvent) {
451+
return false;
452+
}
451453

452454
/*!
453455
@brief Gets a sensor's gravity vector value.
@@ -465,7 +467,9 @@ class drvBase {
465467
@returns True if the sensor value was obtained successfully, False
466468
otherwise.
467469
*/
468-
virtual bool getEventLinearAcceleration(sensors_event_t *linearAccelEvent) { return false; }
470+
virtual bool getEventLinearAcceleration(sensors_event_t *linearAccelEvent) {
471+
return false;
472+
}
469473

470474
/*!
471475
@brief Gets a sensor's rotation vector value.
@@ -474,7 +478,9 @@ class drvBase {
474478
@returns True if the sensor value was obtained successfully, False
475479
otherwise.
476480
*/
477-
virtual bool getEventRotationVector(sensors_event_t *rotationEvent) { return false; }
481+
virtual bool getEventRotationVector(sensors_event_t *rotationEvent) {
482+
return false;
483+
}
478484

479485
/*!
480486
@brief Gets a sensor's gyroscope value.
@@ -491,7 +497,9 @@ class drvBase {
491497
@returns True if the sensor value was obtained successfully, False
492498
otherwise.
493499
*/
494-
virtual bool getEventAccelerometer(sensors_event_t *accelEvent) { return false; }
500+
virtual bool getEventAccelerometer(sensors_event_t *accelEvent) {
501+
return false;
502+
}
495503

496504
/*!
497505
@brief Gets a sensor's orientation value.
@@ -500,7 +508,9 @@ class drvBase {
500508
@returns True if the sensor value was obtained successfully, False
501509
otherwise.
502510
*/
503-
virtual bool getEventOrientation(sensors_event_t *orientationEvent) { return false; }
511+
virtual bool getEventOrientation(sensors_event_t *orientationEvent) {
512+
return false;
513+
}
504514

505515
/*!
506516
@brief Gets a sensor's rotation vector value.
@@ -509,7 +519,9 @@ class drvBase {
509519
@returns True if the sensor value was obtained successfully, False
510520
otherwise.
511521
*/
512-
virtual bool getEventRotationVector(sensors_event_t *rotationEvent) { return false; }
522+
virtual bool getEventRotationVector(sensors_event_t *rotationEvent) {
523+
return false;
524+
}
513525

514526
/*!
515527
@brief Gets a sensor's Raw value.
@@ -764,8 +776,7 @@ class drvBase {
764776
{wippersnapper_sensor_SensorType_SENSOR_TYPE_ROTATION_VECTOR,
765777
[this](sensors_event_t *event) -> bool {
766778
return this->getEventRotationVector(event);
767-
}}
768-
}; ///< SensorType to function call map
779+
}}}; ///< SensorType to function call map
769780

770781
wippersnapper_sensor_SensorType
771782
_sensors[15]; ///< Sensors attached to the device.

src/components/i2c/drivers/drvQmc5883p.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
#include "drvQmc5883p.h"
17+
1718
#include <Adafruit_QMC5883P.h>
1819

1920
/*******************************************************************************/

src/components/i2c/drivers/drvQmc5883p.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717

1818
#include "drvBase.h"
1919

20-
class Adafruit_QMC5883P; // forward
20+
class Adafruit_QMC5883P; // forward
2121

2222
/**************************************************************************/
2323
/*!
2424
@brief Class that provides a driver interface for a QMC5883P sensor.
2525
*/
2626
/**************************************************************************/
2727
class drvQmc5883p : public drvBase {
28-
public:
28+
public:
2929
/*******************************************************************************/
3030
/*!
3131
@brief Constructor for a QMC5883P sensor.
@@ -82,8 +82,8 @@ class drvQmc5883p : public drvBase {
8282

8383
void ConfigureDefaultSensorTypes() override;
8484

85-
protected:
86-
Adafruit_QMC5883P *_qmc = nullptr; ///< Pointer to QMC5883P sensor object
85+
protected:
86+
Adafruit_QMC5883P *_qmc = nullptr; ///< Pointer to QMC5883P sensor object
8787
};
8888

89-
#endif // DRV_QMC5883P_H
89+
#endif // DRV_QMC5883P_H

src/components/i2c/model.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,15 @@ bool I2cModel::AddI2cDeviceSensorEvent(
436436
.i2c_device_events[_msg_i2c_device_event.i2c_device_events_count]
437437
.type = sensor_type;
438438
if (sensor_type ==
439-
wippersnapper_sensor_SensorType_SENSOR_TYPE_MAGNETIC_FIELD || sensor_type ==
440-
wippersnapper_sensor_SensorType_SENSOR_TYPE_ACCELEROMETER || sensor_type ==
441-
wippersnapper_sensor_SensorType_SENSOR_TYPE_GYROSCOPE || sensor_type ==
442-
wippersnapper_sensor_SensorType_SENSOR_TYPE_GRAVITY || sensor_type ==
443-
wippersnapper_sensor_SensorType_SENSOR_TYPE_LINEAR_ACCELERATION) {
444-
wippersnapper_sensor_SensorEvent_SensorEvent3DVector value_vect = GetValueFromSensorsEventVector(sensor_type, &event);
439+
wippersnapper_sensor_SensorType_SENSOR_TYPE_MAGNETIC_FIELD ||
440+
sensor_type ==
441+
wippersnapper_sensor_SensorType_SENSOR_TYPE_ACCELEROMETER ||
442+
sensor_type == wippersnapper_sensor_SensorType_SENSOR_TYPE_GYROSCOPE ||
443+
sensor_type == wippersnapper_sensor_SensorType_SENSOR_TYPE_GRAVITY ||
444+
sensor_type ==
445+
wippersnapper_sensor_SensorType_SENSOR_TYPE_LINEAR_ACCELERATION) {
446+
wippersnapper_sensor_SensorEvent_SensorEvent3DVector value_vect =
447+
GetValueFromSensorsEventVector(sensor_type, &event);
445448
_msg_i2c_device_event
446449
.i2c_device_events[_msg_i2c_device_event.i2c_device_events_count]
447450
.value.vector_value.x = value_vect.x;
@@ -451,9 +454,12 @@ bool I2cModel::AddI2cDeviceSensorEvent(
451454
_msg_i2c_device_event
452455
.i2c_device_events[_msg_i2c_device_event.i2c_device_events_count]
453456
.value.vector_value.z = value_vect.z;
454-
} else if (sensor_type == wippersnapper_sensor_SensorType_SENSOR_TYPE_ORIENTATION || sensor_type ==
455-
wippersnapper_sensor_SensorType_SENSOR_TYPE_ROTATION_VECTOR) {
456-
wippersnapper_sensor_SensorEvent_SensorEventOrientation value_vect = GetValueFromSensorsEventOrientation(sensor_type, &event);
457+
} else if (sensor_type ==
458+
wippersnapper_sensor_SensorType_SENSOR_TYPE_ORIENTATION ||
459+
sensor_type ==
460+
wippersnapper_sensor_SensorType_SENSOR_TYPE_ROTATION_VECTOR) {
461+
wippersnapper_sensor_SensorEvent_SensorEventOrientation value_vect =
462+
GetValueFromSensorsEventOrientation(sensor_type, &event);
457463
_msg_i2c_device_event
458464
.i2c_device_events[_msg_i2c_device_event.i2c_device_events_count]
459465
.value.orientation_value.heading = value_vect.heading;
@@ -463,7 +469,7 @@ bool I2cModel::AddI2cDeviceSensorEvent(
463469
_msg_i2c_device_event
464470
.i2c_device_events[_msg_i2c_device_event.i2c_device_events_count]
465471
.value.orientation_value.pitch = value_vect.pitch;
466-
//TODO: Add color RGB(A) vector support
472+
// TODO: Add color RGB(A) vector support
467473
} else {
468474
float value = GetValueFromSensorsEvent(sensor_type, &event);
469475
_msg_i2c_device_event

0 commit comments

Comments
 (0)