2021-02-24 06:11 PM
According the official API code
in vl53l0x_api.c , comment says enter standby
but the code was set idle ?
Which one is correct ?
VL53L0X_Error VL53L0X_StaticInit(VL53L0X_DEV Dev) {
...
/* Set PAL State to standby */
if (Status == VL53L0X_ERROR_NONE)
PALDevDataSet(Dev, PalState, VL53L0X_STATE_IDLE);
...
}
and the define was different
#define VL53L0X_STATE_STANDBY ((VL53L0X_State) 2)
/*!< Device is in Low power Standby mode */
#define VL53L0X_STATE_IDLE ((VL53L0X_State) 3)
/*!< Device has been initialized and ready to do measurements */
2022-01-04 07:51 AM
I was told long ago to never trust the comments.
Programmers frequently change the code to make it work, but never go back an update the comments to reflect those changes.
ST's Time-of-Flight group has come a long way since the early days of the VL53L0X, but we've never had time to go back an polish the code the way we should.
I'm pretty sure it's just the comment that is in error here.