@@ -70,28 +70,29 @@ class WipperSnapper_I2C_Driver_VL53L4CD : public WipperSnapper_I2C_Driver {
70
70
return false ;
71
71
}
72
72
73
- uint16_t signalThreshold = - 1 ;
74
- if ( _VL53L4CD->VL53L4CD_GetSignalThreshold (&signalThreshold) ! =
73
+ if ( uint16_t signalThreshold;
74
+ _VL53L4CD->VL53L4CD_GetSignalThreshold (&signalThreshold) = =
75
75
VL53L4CD_ERROR_NONE) {
76
- WS_DEBUG_PRINTLN (" Failed to get VL53L4CD signal threshold!" );
77
- } else {
78
76
WS_DEBUG_PRINT (" VL53L4CD old signal threshold: " );
79
77
WS_DEBUG_PRINTLN (signalThreshold);
80
- }
81
- if (_VL53L4CD->VL53L4CD_SetSignalThreshold (50 ) != VL53L4CD_ERROR_NONE) {
82
- WS_DEBUG_PRINTLN (" Failed to set new VL53L4CD signal threshold!" );
78
+ WS_DEBUG_PRINTLN (" Setting VL53L4CD signal threshold to 50" );
79
+ if (_VL53L4CD->VL53L4CD_SetSignalThreshold (50 ) != VL53L4CD_ERROR_NONE) {
80
+ WS_DEBUG_PRINTLN (" Failed to set new VL53L4CD signal threshold!" );
81
+ }
82
+ } else {
83
+ WS_DEBUG_PRINTLN (" Failed to get VL53L4CD signal threshold!" );
83
84
}
84
85
85
- uint16_t sigmaThreshold = -1 ;
86
- if (_VL53L4CD->VL53L4CD_GetSigmaThreshold (&sigmaThreshold) !=
87
- VL53L4CD_ERROR_NONE) {
88
- WS_DEBUG_PRINTLN (" Failed to get VL53L4CD sigma threshold!" );
89
- } else {
86
+ if (uint16_t sigmaThreshold; _VL53L4CD->VL53L4CD_GetSigmaThreshold (
87
+ &sigmaThreshold) == VL53L4CD_ERROR_NONE) {
90
88
WS_DEBUG_PRINT (" VL53L4CD old sigma threshold: " );
91
89
WS_DEBUG_PRINTLN (sigmaThreshold);
92
- }
93
- if (_VL53L4CD->VL53L4CD_SetSigmaThreshold (100 ) != VL53L4CD_ERROR_NONE) {
94
- WS_DEBUG_PRINTLN (" Failed to set VL53L4CD sigma threshold!" );
90
+ WS_DEBUG_PRINTLN (" Setting VL53L4CD sigma threshold to 100" );
91
+ if (_VL53L4CD->VL53L4CD_SetSigmaThreshold (100 ) != VL53L4CD_ERROR_NONE) {
92
+ WS_DEBUG_PRINTLN (" Failed to set VL53L4CD sigma threshold!" );
93
+ }
94
+ } else {
95
+ WS_DEBUG_PRINTLN (" Failed to get VL53L4CD sigma threshold!" );
95
96
}
96
97
97
98
if (_VL53L4CD->VL53L4CD_StartRanging () != VL53L4CD_ERROR_NONE) {
0 commit comments