Skip to content

Commit

Permalink
Added typecase to uint8_t for calculated requested data length variab…
Browse files Browse the repository at this point in the history
…le in readWords() method for TwoWire::requestFrom() compatibility
  • Loading branch information
jrowberg committed Aug 5, 2011
1 parent f095eb0 commit 4bb6b3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion I2Cdev.cpp
Expand Up @@ -222,7 +222,7 @@ int8_t I2Cdev::readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint1
Wire.endTransmission();

Wire.beginTransmission(devAddr);
Wire.requestFrom(devAddr, length * 2); // length=words, this wants bytes
Wire.requestFrom(devAddr, (uint8_t)(length * 2)); // length=words, this wants bytes

uint32_t t1 = millis();
bool msb = true; // starts with MSB, then LSB
Expand Down

0 comments on commit 4bb6b3f

Please sign in to comment.