diff --git a/drivers/bmx055/bmx055_saul.c b/drivers/bmx055/bmx055_saul.c index 1548440c7227c314adb46197224e34d1f4cdf0bf..921e59791174ede74aa03137b5b550bb10b3fa09 100644 --- a/drivers/bmx055/bmx055_saul.c +++ b/drivers/bmx055/bmx055_saul.c @@ -24,7 +24,9 @@ static int read_mag(const void *dev, phydat_t *res) { - if (bmx055_mag_read((bmx055_t *)dev, (int16_t *)res) != BMX055_OK) { + const bmx055_t *mydev = (const bmx055_t *)dev; + + if (bmx055_mag_read(mydev, res->val) != BMX055_OK) { return 0; } res->unit = UNIT_GS; @@ -34,7 +36,9 @@ static int read_mag(const void *dev, phydat_t *res) static int read_acc(const void *dev, phydat_t *res) { - if (bmx055_acc_read((bmx055_t *)dev, (int16_t *)res) != BMX055_OK) { + const bmx055_t *mydev = (const bmx055_t *)dev; + + if (bmx055_acc_read(mydev, res->val) != BMX055_OK) { return 0; } res->unit = UNIT_G; @@ -44,7 +48,9 @@ static int read_acc(const void *dev, phydat_t *res) static int read_gyro(const void *dev, phydat_t *res) { - if (bmx055_gyro_read((bmx055_t *)dev, (int16_t *)res) != BMX055_OK) { + const bmx055_t *mydev = (const bmx055_t *)dev; + + if (bmx055_gyro_read(mydev, res->val) != BMX055_OK) { return 0; } res->unit = UNIT_DPS;