Skip to content

Bugfix for registers>0x00FF #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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