Skip to content

Commit

Permalink
fix: changed FIFO read for accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
HannahCutler committed Aug 26, 2024
1 parent 2097ce3 commit 8d4680a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/imu/imu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ bool getDMPAccelerometerAcc(float* acc_acc)
if ((myICM.status == ICM_20948_Stat_Ok) || (myICM.status == ICM_20948_Stat_FIFOMoreDataAvail))
{

if ((data.header2 & DMP_header2_bitmap_Accel_Accuracy) != 0)
if (((data.header2 & DMP_header2_bitmap_Accel_Accuracy) != 0) && ((data.header & DMP_header_bitmap_Accel) != 0))
{
*acc_acc = (float)data.Accel_Accuracy;
} else {
Expand All @@ -225,7 +225,7 @@ bool getDMPAccelerometerAcc(float* acc_acc)
else
{
*acc_acc = 10;
//FLOG_AddError(FLOG_ACC_FAIL, 4);
FLOG_AddError(FLOG_ACC_FAIL, 4);
}
return true;

Expand Down

0 comments on commit 8d4680a

Please sign in to comment.