Skip to content

Commit

Permalink
Merge pull request #5 from NoahRosa/master
Browse files Browse the repository at this point in the history
Fixed warnings and added sam compatibility
  • Loading branch information
cparata authored Mar 1, 2019
2 parents ea1c8fe + c050de5 commit cf46108
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=STM32duino VL53L1X
version=1.0.1
version=1.0.2
author=AST
maintainer=stm32duino
sentence=Allows controlling the VL53L1X (Time-of-Flight and gesture detection sensor)
paragraph=This library provides simple measure distance in mm, single swipe gesture detection, directional (left/right) swipe gesture detection and single tap gesture detection.
category=Device Control
url=https://github.com/stm32duino/VL53L1X
architectures=stm32, avr
architectures=stm32, avr, sam
6 changes: 3 additions & 3 deletions src/vl53l1x_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ VL53L1X_ERROR VL53L1X::VL53L1X_GetSensorId(uint16_t *sensorId)
VL53L1X_ERROR VL53L1X::VL53L1X_GetDistance(uint16_t *distance)
{
VL53L1X_ERROR status = 0;
uint16_t tmp;
uint16_t tmp = 0;

status = (VL53L1_RdWord(Device,
VL53L1_RESULT__FINAL_CROSSTALK_CORRECTED_RANGE_MM_SD0, &tmp));
Expand Down Expand Up @@ -1011,7 +1011,7 @@ VL53L1X_ERROR VL53L1X::VL53L1_RdDWord(VL53L1_DEV Dev, uint16_t index, uint32_t *
status = VL53L1_I2CRead(Dev->I2cDevAddr, index, buffer, 4);
if(!status)
{
*data = (buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3];
*data = ((uint32_t)buffer[0] << 24) + ((uint32_t)buffer[1] << 16) + ((uint32_t)buffer[2] << 8) + (uint32_t)buffer[3];
}
return status;

Expand Down Expand Up @@ -1047,7 +1047,7 @@ VL53L1X_ERROR VL53L1X::VL53L1_I2CWrite(uint8_t DeviceAddr, uint16_t RegisterAddr
buffer[0]=(uint8_t) RegisterAddr>>8;
buffer[1]=(uint8_t) RegisterAddr&0xFF;
dev_i2c->write(buffer, 2);
for (int i = 0 ; i < NumByteToWrite ; i++)
for (uint16_t i = 0 ; i < NumByteToWrite ; i++)
dev_i2c->write(pBuffer[i]);

dev_i2c->endTransmission(true);
Expand Down
1 change: 0 additions & 1 deletion src/vl53l1x_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

typedef int8_t VL53L1X_ERROR;

#define SOFT_RESET 0x0000
#define VL53L1_I2C_SLAVE__DEVICE_ADDRESS 0x0001
#define VL53L1_VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND 0x0008
#define ALGO__CROSSTALK_COMPENSATION_PLANE_OFFSET_KCPS 0x0016
Expand Down

0 comments on commit cf46108

Please sign in to comment.