drivers/mma8x5x: correct cast of phydat_t*

The read functions have a mma8x5x_data_t* argument which is a
struct with 3 int16_t members. Thus we should cast res->val instead of
just res.
This commit is contained in:
Kees Bakker 2019-01-06 18:11:46 +01:00
parent ab17629b97
commit cf560eaca7

View File

@ -27,7 +27,7 @@
static int read_acc(const void *dev, phydat_t *res)
{
mma8x5x_read((const mma8x5x_t *)dev, (mma8x5x_data_t *)res);
mma8x5x_read((const mma8x5x_t *)dev, (mma8x5x_data_t *)res->val);
res->unit = UNIT_G;
res->scale = -3;