Skip to content
Snippets Groups Projects
Commit 37d8709f authored by Kees Bakker's avatar Kees Bakker
Browse files

drivers/lsm303dlhc: correct cast of phydat_t*

The read functions have a lsm303dlhc_3d_data_t* argument which is a
struct with 3 int16_t members. Thus we should cast res->val instead of
just res.
parent b77c802f
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@
static int read_acc(const void *dev, phydat_t *res)
{
const lsm303dlhc_t *d = (const lsm303dlhc_t *)dev;
lsm303dlhc_read_acc(d, (lsm303dlhc_3d_data_t *)res);
lsm303dlhc_read_acc(d, (lsm303dlhc_3d_data_t *)res->val);
/* normalize result */
int fac = (1 << (d->params.acc_scale >> 4));
......@@ -43,7 +43,7 @@ static int read_mag(const void *dev, phydat_t *res)
{
const lsm303dlhc_t *d = (const lsm303dlhc_t *)dev;
lsm303dlhc_read_mag(d, (lsm303dlhc_3d_data_t *)res);
lsm303dlhc_read_mag(d, (lsm303dlhc_3d_data_t *)res->val);
/* normalize results */
int gain;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment