sparkfun / SparkFun_LSM9DS1_Arduino_Library

Arduino library for the LSM9DS1 9DOF IMU.
Other
64 stars 78 forks source link

I2CreadBytes should return an unsigned int #2

Closed sensestage closed 7 years ago

sensestage commented 9 years ago

The function I2CreadBytes returns an unsigned integer, but uses -1 as an error indication. So the return variable (and probably the input argument count) should be int8 instead.

uint8_t LSM9DS1::I2CreadBytes(uint8_t address, uint8_t subAddress, uint8_t * dest, uint8_t count)

jimblom commented 7 years ago

Good catch! Fixed in commit 6a48fe7. And return value is now checked by functions that use the multi-byte i2c read.