i2c: use mraa 1.0 types for i2c sensors

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Brendan Le Foll
2016-04-25 14:41:08 +01:00
committed by Noel Eck
parent e51c5f3018
commit 48d5426350
4 changed files with 35 additions and 7 deletions

View File

@ -80,7 +80,11 @@ bool MMA7660::writeByte(uint8_t reg, uint8_t byte)
uint8_t MMA7660::readByte(uint8_t reg)
{
return mraa_i2c_read_byte_data(m_i2c, reg);
int x = mraa_i2c_read_byte_data(m_i2c, reg);
if (x != -1) {
return (uint8_t) x;
}
return 0;
}
void MMA7660::getRawValues(int *x, int *y, int *z)