mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
OSD G-force Fix unit test; use sqrtf
This commit is contained in:
parent
51e57199fb
commit
7df8075fa3
2 changed files with 6 additions and 2 deletions
|
@ -696,8 +696,8 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
const float a = accAverage[axis];
|
||||
osdGForce += a * a;
|
||||
}
|
||||
osdGForce = pow_approx(osdGForce, 0.5) / acc.dev.acc_1G;
|
||||
tfp_sprintf(buff, "%01d.%01d%c", (uint8_t)osdGForce, (uint8_t)(osdGForce * 10) % 10, "G");
|
||||
osdGForce = sqrtf(osdGForce) / acc.dev.acc_1G;
|
||||
tfp_sprintf(buff, "%01d.%01d%c", (int)osdGForce, (int)(osdGForce * 10) % 10, "G");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue