Skip to content

Commit 9be1e4f

Browse files
committed
Reorder init statements for VL53L4CX
1 parent 1409eae commit 9be1e4f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_VL53L4CX.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ class WipperSnapper_I2C_Driver_VL53L4CX : public WipperSnapper_I2C_Driver {
6868
return false;
6969
}
7070

71-
// Set 1 second measurement time, the highest possible TimingBudget is 10s
72-
if (_VL53L4CX->VL53L4CX_SetMeasurementTimingBudgetMicroSeconds(1000000) !=
71+
if (_VL53L4CX->VL53L4CX_SetDistanceMode(VL53L4CX_DISTANCEMODE_LONG) !=
7372
VL53L4CX_ERROR_NONE) {
74-
WS_DEBUG_PRINTLN("Failed to set VL53L4CX timing budget!");
73+
WS_DEBUG_PRINTLN("Failed to set VL53L4CX distance mode to long!");
7574
return false;
7675
}
7776

78-
if (_VL53L4CX->VL53L4CX_SetDistanceMode(VL53L4CX_DISTANCEMODE_LONG) !=
77+
// Set 1 second measurement time, the highest possible TimingBudget is 10s
78+
if (_VL53L4CX->VL53L4CX_SetMeasurementTimingBudgetMicroSeconds(1000000) !=
7979
VL53L4CX_ERROR_NONE) {
80-
WS_DEBUG_PRINTLN("Failed to set VL53L4CX distance mode to long!");
80+
WS_DEBUG_PRINTLN("Failed to set VL53L4CX timing budget!");
8181
return false;
8282
}
83-
83+
8484
if (_VL53L4CX->VL53L4CX_StartMeasurement() != VL53L4CX_ERROR_NONE) {
8585
WS_DEBUG_PRINTLN("Failed to start VL53L4CX ranging!");
8686
return false;

0 commit comments

Comments
 (0)