add max range to 2000 mm
This commit is contained in:
parent
905032167a
commit
8520de3835
|
@ -44,6 +44,7 @@
|
|||
* @defgroup ErrCode Errors code shown on display
|
||||
* @{
|
||||
*/
|
||||
#define STS_MAX_L0_RANGE ((uint32_t) 2000)
|
||||
#define ERR_DETECT -1
|
||||
#define ERR_DEMO_RANGE_ONE 1
|
||||
#define ERR_DEMO_RANGE_MULTI 2
|
||||
|
@ -367,17 +368,15 @@ void STS_TOF_VL53L0X_Range_Process(void)
|
|||
nSensorPresent = sts_tof_vl53l0x_DetectSensors(); // confirm sensor online
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "\r\n %u pcs sensor(s) online \r\n", nSensorPresent);
|
||||
}
|
||||
sts_tof_distance_data[0] = 0;
|
||||
sts_tof_distance_data[1] = 0;
|
||||
sts_tof_distance_data[2] = 0;
|
||||
sts_tof_distance_data[0] = STS_MAX_L0_RANGE;
|
||||
sts_tof_distance_data[1] = STS_MAX_L0_RANGE;
|
||||
sts_tof_distance_data[2] = STS_MAX_L0_RANGE;
|
||||
|
||||
if (nSensorPresent > 0)
|
||||
{
|
||||
// RangingConfig == HIGH ACCURACY, LONG RANGE, HIGH SPEED
|
||||
sts_tof_vl53l0x_SetupSingleShot(RangingConfig);
|
||||
sts_tof_distance_data[0]=0;
|
||||
sts_tof_distance_data[1]=0;
|
||||
sts_tof_distance_data[2]=0;
|
||||
|
||||
sensor_data_ready = 0 ;
|
||||
for (i=0; i< MAX_TOF_COUNT; i++)
|
||||
{
|
||||
|
@ -390,6 +389,7 @@ void STS_TOF_VL53L0X_Range_Process(void)
|
|||
if( RangingMeasurementData.RangeStatus == 0 )
|
||||
{
|
||||
sts_tof_distance_data[i] = (int)VL53L0XDevs[i].LeakyRange;
|
||||
if (sts_tof_distance_data[i] ==0) sts_tof_distance_data[i]+= STS_MAX_L0_RANGE;
|
||||
nDevMask |= (1 << i);
|
||||
sensor_data_ready |= 1;
|
||||
} else
|
||||
|
|
Loading…
Reference in New Issue