Skip to content

Commit

Permalink
Merge pull request #8 from NoahRosa/master
Browse files Browse the repository at this point in the history
Bugfix for registers>0x00FF
  • Loading branch information
cparata authored Apr 26, 2019
2 parents cf46108 + 85f59dc commit 5b65497
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=STM32duino VL53L1X
version=1.0.2
version=1.0.3
author=AST
maintainer=stm32duino
sentence=Allows controlling the VL53L1X (Time-of-Flight and gesture detection sensor)
Expand Down
8 changes: 4 additions & 4 deletions src/vl53l1x_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,8 @@ VL53L1X_ERROR VL53L1X::VL53L1_I2CWrite(uint8_t DeviceAddr, uint16_t RegisterAddr
Serial.println(RegisterAddr);
#endif
uint8_t buffer[2];
buffer[0]=(uint8_t) RegisterAddr>>8;
buffer[1]=(uint8_t) RegisterAddr&0xFF;
buffer[0]=(uint8_t) (RegisterAddr>>8);
buffer[1]=(uint8_t) (RegisterAddr&0xFF);
dev_i2c->write(buffer, 2);
for (uint16_t i = 0 ; i < NumByteToWrite ; i++)
dev_i2c->write(pBuffer[i]);
Expand All @@ -1070,8 +1070,8 @@ VL53L1X_ERROR VL53L1X::VL53L1_I2CRead(uint8_t DeviceAddr, uint16_t RegisterAddr,
Serial.println(RegisterAddr);
#endif
uint8_t buffer[2];
buffer[0]=(uint8_t) RegisterAddr>>8;
buffer[1]=(uint8_t) RegisterAddr&0xFF;
buffer[0]=(uint8_t) (RegisterAddr>>8);
buffer[1]=(uint8_t) (RegisterAddr&0xFF);
dev_i2c->write(buffer, 2);
status = dev_i2c->endTransmission(false);
//Fix for some STM32 boards
Expand Down

0 comments on commit 5b65497

Please sign in to comment.