1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #10712 from keestux/lsm303dlhc-correct-phydat-cast

drivers/lsm303dlhc: correct cast of phydat_t*
This commit is contained in:
Sebastian Meiling 2019-01-07 14:33:12 +01:00 committed by GitHub
commit c999d3a592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -26,7 +26,7 @@
static int read_mag(const void *dev, phydat_t *res)
{
mag3110_read((const mag3110_t *)dev, (mag3110_data_t *)res);
mag3110_read((const mag3110_t *)dev, (mag3110_data_t *)res->val);
res->unit = UNIT_GS;
res->scale = 2;

View File

@ -26,7 +26,7 @@
static int read_acc(const void *dev, phydat_t *res)
{
mma7660_read((const mma7660_t *)dev, (mma7660_data_t *)res);
mma7660_read((const mma7660_t *)dev, (mma7660_data_t *)res->val);
res->unit = UNIT_G;
res->scale = -3;

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;

View File

@ -25,7 +25,7 @@
static int read_acc(const void *dev, phydat_t *res)
{
int ret = mpu9150_read_accel((const mpu9150_t *)dev, (mpu9150_results_t *)res);
int ret = mpu9150_read_accel((const mpu9150_t *)dev, (mpu9150_results_t *)res->val);
if (ret < 0) {
return -ECANCELED;
}
@ -38,7 +38,7 @@ static int read_acc(const void *dev, phydat_t *res)
static int read_gyro(const void *dev, phydat_t *res)
{
int ret = mpu9150_read_gyro((const mpu9150_t *)dev, (mpu9150_results_t *)res);
int ret = mpu9150_read_gyro((const mpu9150_t *)dev, (mpu9150_results_t *)res->val);
if (ret < 0) {
return -ECANCELED;
}
@ -51,7 +51,7 @@ static int read_gyro(const void *dev, phydat_t *res)
static int read_mag(const void *dev, phydat_t *res)
{
int ret = mpu9150_read_compass((const mpu9150_t *)dev, (mpu9150_results_t *)res);
int ret = mpu9150_read_compass((const mpu9150_t *)dev, (mpu9150_results_t *)res->val);
if (ret < 0) {
return -ECANCELED;
}