Skip to content
Merged
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
8 changes: 4 additions & 4 deletions src/vl53l1x_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,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]=RegisterAddr>>8;
buffer[1]=RegisterAddr&0xFF;
dev_i2c->write(buffer, 2);
for (int i = 0 ; i < NumByteToWrite ; i++)
dev_i2c->write(pBuffer[i]);
Expand All @@ -1049,8 +1049,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]=RegisterAddr>>8;
buffer[1]=RegisterAddr&0xFF;
dev_i2c->write(buffer, 2);
status = dev_i2c->endTransmission(false);
//Fix for some STM32 boards
Expand Down