Skip to content

Commit

Permalink
VL53L4CX clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed May 3, 2024
1 parent abdb29d commit fc77f10
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/i2c/drivers/WipperSnapper_I2C_Driver_VL53L4CX.h
Expand Up @@ -64,14 +64,16 @@ class WipperSnapper_I2C_Driver_VL53L4CX : public WipperSnapper_I2C_Driver {
WS_DEBUG_PRINTLN("Failed to initialize VL53L4CX sensor!");
return false;
}

// Set 1 second measurement time, the highest possible TimingBudget is 10seconds
if (_VL53L4CX->VL53L4CX_SetMeasurementTimingBudgetMicroSeconds(1000000) != VL53L4CX_ERROR_NONE) {

// Set 1 second measurement time, the highest possible TimingBudget is 10s
if (_VL53L4CX->VL53L4CX_SetMeasurementTimingBudgetMicroSeconds(1000000) !=
VL53L4CX_ERROR_NONE) {
WS_DEBUG_PRINTLN("Failed to set VL53L4CX timing budget!");
return false;
}

if (_VL53L4CX->VL53L4CX_SetDistanceMode(VL53L4CX_DISTANCEMODE_LONG) != VL53L4CX_ERROR_NONE) {
if (_VL53L4CX->VL53L4CX_SetDistanceMode(VL53L4CX_DISTANCEMODE_LONG) !=
VL53L4CX_ERROR_NONE) {
WS_DEBUG_PRINTLN("Failed to set VL53L4CX distance mode to long!");
}

Expand Down Expand Up @@ -133,10 +135,11 @@ class WipperSnapper_I2C_Driver_VL53L4CX : public WipperSnapper_I2C_Driver {
delay(250);

for (uint8_t retries = 0;
(status = _VL53L4CX->VL53L4CX_GetMeasurementDataReady(&NewDataReady)) &&
(status =
_VL53L4CX->VL53L4CX_GetMeasurementDataReady(&NewDataReady)) &&
!NewDataReady && retries < 3;
retries++) {
delay(300);
delay(350);
WS_DEBUG_PRINT(" .");
}
WS_DEBUG_PRINTLN("");
Expand Down

0 comments on commit fc77f10

Please sign in to comment.