Skip to content
Snippets Groups Projects
Unverified Commit 5f827b1a authored by Sebastian Meiling's avatar Sebastian Meiling Committed by GitHub
Browse files

Merge pull request #10704 from keestux/eliminate-casts-bmx055

drivers/bmx055: eliminate some casts
parents f6f42b61 52102a7a
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment