Skip to content

Commit cbc36ca

Browse files
committed
Define timing budget macro for VL53L4CX
1 parent d5439f2 commit cbc36ca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_VL53L4CX.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
#include <vl53l4cx_class.h>
2020
#include <vl53l4cx_def.h>
2121

22-
#define VL53_SHUTDOWN_PIN -1 ///< Shutdown pin for VL53L4CX sensor
23-
#define VL53_READING_DELAY 250 ///< Delay for reading data attempts
22+
#define VL53_SHUTDOWN_PIN -1 ///< Shutdown pin for VL53L4CX sensor
23+
#define VL53_READING_DELAY 250 ///< Delay for reading data attempts
24+
#define VL53_TIMING_BUDGET_NS 200000 ///< Timing budget for VL53L4CX sensor
2425

2526
/**************************************************************************/
2627
/*!
@@ -75,8 +76,8 @@ class WipperSnapper_I2C_Driver_VL53L4CX : public WipperSnapper_I2C_Driver {
7576
}
7677

7778
// Set 200ms measurement time, the possible TimingBudget is 8-200ms
78-
if (_VL53L4CX->VL53L4CX_SetMeasurementTimingBudgetMicroSeconds(200000) !=
79-
VL53L4CX_ERROR_NONE) {
79+
if (_VL53L4CX->VL53L4CX_SetMeasurementTimingBudgetMicroSeconds(
80+
VL53_TIMING_BUDGET_NS) != VL53L4CX_ERROR_NONE) {
8081
WS_DEBUG_PRINTLN("Failed to set VL53L4CX timing budget!");
8182
return false;
8283
}

0 commit comments

Comments
 (0)