Skip to content

Add word size to integer literals #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/SparkFunMPU9250-DMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,9 @@ float MPU9250_DMP::qToFloat(long number, unsigned char q)
unsigned long mask = 0;
for (int i=0; i<q; i++)
{
mask |= (1<<i);
mask |= (1L<<i);
}
return (number >> q) + ((number & mask) / (float) (2<<(q-1)));
return (number >> q) + ((number & mask) / (float) (2L<<(q-1)));
}

void MPU9250_DMP::computeEulerAngles(bool degrees)
Expand Down Expand Up @@ -700,4 +700,4 @@ static void tap_cb(unsigned char direction, unsigned char count)
static void orient_cb(unsigned char orient)
{
mpu9250_orientation = orient;
}
}