File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -164,12 +164,12 @@ uint16_t SFEVL53L1X::getTimingBudgetInMs()
164
164
165
165
void SFEVL53L1X::setDistanceModeLong ()
166
166
{
167
- _device->VL53L1X_SetDistanceMode (2 );
167
+ _device->VL53L1X_SetDistanceMode (DISTANCE_LONG );
168
168
}
169
169
170
170
void SFEVL53L1X::setDistanceModeShort ()
171
171
{
172
- _device->VL53L1X_SetDistanceMode (1 );
172
+ _device->VL53L1X_SetDistanceMode (DISTANCE_SHORT );
173
173
}
174
174
175
175
uint8_t SFEVL53L1X::getDistanceMode ()
@@ -368,9 +368,9 @@ void SFEVL53L1X::calibrateXTalk(uint16_t targetDistanceInMm)
368
368
369
369
bool SFEVL53L1X::setThresholdConfig (DetectionConfig *config)
370
370
{
371
- VL53L1X_ERROR error = _device->VL53L1X_SetDistanceThreshold (config->thresholdLow , config-> thresholdHigh ,
372
- ( uint8_t ) config->windowMode , ( uint8_t ) config->IntOnNoTarget );
373
- return (error == VL53L1_ERROR_NONE) ;
371
+ return _device->VL53L1X_SetDistanceMode (config->distanceMode ) == VL53L1_ERROR_NONE &&
372
+ _device-> VL53L1X_SetDistanceThreshold ( config->thresholdLow , config->thresholdHigh ,
373
+ ( uint8_t )config-> windowMode , ( uint8_t )config-> IntOnNoTarget ) == VL53L1_ERROR_NONE;
374
374
}
375
375
376
376
bool SFEVL53L1X::getThresholdConfig (DetectionConfig *config)
Original file line number Diff line number Diff line change 30
30
#include " vl53l1_error_codes.h"
31
31
#include " vl53l1x_class.h"
32
32
33
- #define DISTANCE_SHORT 0
34
- #define DISTANCE_LONG 1
33
+ #define DISTANCE_SHORT 1
34
+ #define DISTANCE_LONG 2
35
35
#define WINDOW_BELOW 0
36
36
#define WINDOW_ABOVE 1
37
37
#define WINDOW_OUT 2
You can’t perform that action at this time.
0 commit comments