Skip to content

Commit f25d8ac

Browse files
committed
Please clang-format and rejig thresholds
1 parent 0cbab92 commit f25d8ac

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_VL53L4CD.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,29 @@ class WipperSnapper_I2C_Driver_VL53L4CD : public WipperSnapper_I2C_Driver {
7070
return false;
7171
}
7272

73-
uint16_t signalThreshold = -1;
74-
if (_VL53L4CD->VL53L4CD_GetSignalThreshold(&signalThreshold) !=
73+
if (uint16_t signalThreshold;
74+
_VL53L4CD->VL53L4CD_GetSignalThreshold(&signalThreshold) ==
7575
VL53L4CD_ERROR_NONE) {
76-
WS_DEBUG_PRINTLN("Failed to get VL53L4CD signal threshold!");
77-
} else {
7876
WS_DEBUG_PRINT("VL53L4CD old signal threshold: ");
7977
WS_DEBUG_PRINTLN(signalThreshold);
80-
}
81-
if (_VL53L4CD->VL53L4CD_SetSignalThreshold(50) != VL53L4CD_ERROR_NONE) {
82-
WS_DEBUG_PRINTLN("Failed to set new VL53L4CD signal threshold!");
78+
WS_DEBUG_PRINTLN("Setting VL53L4CD signal threshold to 50");
79+
if (_VL53L4CD->VL53L4CD_SetSignalThreshold(50) != VL53L4CD_ERROR_NONE) {
80+
WS_DEBUG_PRINTLN("Failed to set new VL53L4CD signal threshold!");
81+
}
82+
} else {
83+
WS_DEBUG_PRINTLN("Failed to get VL53L4CD signal threshold!");
8384
}
8485

85-
uint16_t sigmaThreshold = -1;
86-
if (_VL53L4CD->VL53L4CD_GetSigmaThreshold(&sigmaThreshold) !=
87-
VL53L4CD_ERROR_NONE) {
88-
WS_DEBUG_PRINTLN("Failed to get VL53L4CD sigma threshold!");
89-
} else {
86+
if (uint16_t sigmaThreshold; _VL53L4CD->VL53L4CD_GetSigmaThreshold(
87+
&sigmaThreshold) == VL53L4CD_ERROR_NONE) {
9088
WS_DEBUG_PRINT("VL53L4CD old sigma threshold: ");
9189
WS_DEBUG_PRINTLN(sigmaThreshold);
92-
}
93-
if (_VL53L4CD->VL53L4CD_SetSigmaThreshold(100) != VL53L4CD_ERROR_NONE) {
94-
WS_DEBUG_PRINTLN("Failed to set VL53L4CD sigma threshold!");
90+
WS_DEBUG_PRINTLN("Setting VL53L4CD sigma threshold to 100");
91+
if (_VL53L4CD->VL53L4CD_SetSigmaThreshold(100) != VL53L4CD_ERROR_NONE) {
92+
WS_DEBUG_PRINTLN("Failed to set VL53L4CD sigma threshold!");
93+
}
94+
} else {
95+
WS_DEBUG_PRINTLN("Failed to get VL53L4CD sigma threshold!");
9596
}
9697

9798
if (_VL53L4CD->VL53L4CD_StartRanging() != VL53L4CD_ERROR_NONE) {

0 commit comments

Comments
 (0)