Skip to content

Commit

Permalink
Merge pull request #7662 from iNavFlight/dzikuvx-fix-bmi270-acc-axis-…
Browse files Browse the repository at this point in the history
…direction

Fix BMI270 ACC direction for pitch and roll
  • Loading branch information
DzikuVx authored Dec 17, 2021
2 parents c20a985 + 5dc6f56 commit 5a94015
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/drivers/accgyro/accgyro_bmi270.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ static bool bmi270AccReadScratchpad(accDev_t *acc)
bmi270ContextData_t * ctx = busDeviceGetScratchpadMemory(acc->busDev);

if (ctx->lastReadStatus) {
acc->ADCRaw[X] = (int16_t)((ctx->accRaw[1] << 8) | ctx->accRaw[0]);
acc->ADCRaw[Y] = (int16_t)((ctx->accRaw[3] << 8) | ctx->accRaw[2]);
acc->ADCRaw[X] = -(int16_t)((ctx->accRaw[1] << 8) | ctx->accRaw[0]);
acc->ADCRaw[Y] = -(int16_t)((ctx->accRaw[3] << 8) | ctx->accRaw[2]);
acc->ADCRaw[Z] = (int16_t)((ctx->accRaw[5] << 8) | ctx->accRaw[4]);
return true;
}
Expand Down

0 comments on commit 5a94015

Please sign in to comment.