Skip to content

Commit

Permalink
Merge pull request #39 from pimoroni/patch-be-quiet
Browse files Browse the repository at this point in the history
Squash STDOUT debug text
  • Loading branch information
Gadgetoid committed Oct 28, 2020
2 parents c4b80b1 + abe6ffc commit 9244e4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python_lib/vl53l1x_python.c
Expand Up @@ -57,6 +57,7 @@ VL53L1_DEV *initialise(uint8_t i2c_address, uint8_t TCA9548A_Device, uint8_t TCA
VL53L1_DeviceInfo_t DeviceInfo;
int32_t status_int;

#ifdef DEBUG
if (TCA9548A_Device < 8)
{
printf ("VL53L1X Start Ranging Address 0x%02X TCA9548A Device %d TCA9548A Address 0x%02X\n\n",
Expand All @@ -66,6 +67,7 @@ VL53L1_DEV *initialise(uint8_t i2c_address, uint8_t TCA9548A_Device, uint8_t TCA
{
printf ("VL53L1X Start Ranging Address 0x%02X\n\n", i2c_address);
}
#endif

VL53L1_Dev_t *dev = (VL53L1_Dev_t *)malloc(sizeof(VL53L1_Dev_t));
memset(dev, 0, sizeof(VL53L1_Dev_t));
Expand All @@ -83,6 +85,7 @@ VL53L1_DEV *initialise(uint8_t i2c_address, uint8_t TCA9548A_Device, uint8_t TCA
Status = VL53L1_DataInit(dev);
Status = VL53L1_StaticInit(dev);
//if(Status == VL53L1_ERROR_NONE){
#ifdef DEBUG
Status = VL53L1_GetDeviceInfo(dev, &DeviceInfo);
if(Status == VL53L1_ERROR_NONE){
printf("VL53L0X_GetDeviceInfo:\n");
Expand All @@ -92,6 +95,7 @@ VL53L1_DEV *initialise(uint8_t i2c_address, uint8_t TCA9548A_Device, uint8_t TCA
printf("ProductRevisionMajor : %d\n", DeviceInfo.ProductRevisionMajor);
printf("ProductRevisionMinor : %d\n", DeviceInfo.ProductRevisionMinor);
}
#endif
//}

VL53L1_PerformRefSpadManagement(dev);
Expand All @@ -102,7 +106,9 @@ VL53L1_DEV *initialise(uint8_t i2c_address, uint8_t TCA9548A_Device, uint8_t TCA

VL53L1_Error setDeviceAddress(VL53L1_Dev_t *dev, int i2c_address)
{
#ifdef DEBUG
printf("Set addr: %x", i2c_address);
#endif
VL53L1_Error Status = VL53L1_SetDeviceAddress(dev, i2c_address << 1);
if(Status == 0){
dev->I2cDevAddr = i2c_address;
Expand Down

0 comments on commit 9244e4a

Please sign in to comment.