1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Merge pull request #6536 from leocb/Acc-reciprocal

Change divisions by acc_1G to multiply by the reciprocal value
This commit is contained in:
Michael Keller 2018-08-17 00:36:27 +12:00 committed by GitHub
commit 45b6989350
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 11 deletions

View file

@ -710,7 +710,7 @@ static bool osdDrawSingleElement(uint8_t item)
const float a = accAverage[axis];
osdGForce += a * a;
}
osdGForce = sqrtf(osdGForce) / acc.dev.acc_1G;
osdGForce = sqrtf(osdGForce) * acc.dev.acc_1G_rec;
tfp_sprintf(buff, "%01d.%01dG", (int)osdGForce, (int)(osdGForce * 10) % 10);
break;
}