mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 17:55:30 +03:00
OSD G-force - Fixes compile errors and optimize math
This commit is contained in:
parent
0ab2638b31
commit
51e57199fb
1 changed files with 2 additions and 2 deletions
|
@ -696,8 +696,8 @@ static bool osdDrawSingleElement(uint8_t item)
|
||||||
const float a = accAverage[axis];
|
const float a = accAverage[axis];
|
||||||
osdGForce += a * a;
|
osdGForce += a * a;
|
||||||
}
|
}
|
||||||
osdGForce = pow_approx(osdGForce, 0.5) / acc.dev.acc_1G * 10;
|
osdGForce = pow_approx(osdGForce, 0.5) / acc.dev.acc_1G;
|
||||||
tfp_sprintf(buff, "%01d.%01d%c", osdGForce / 10, osdGForce % 10, "G");
|
tfp_sprintf(buff, "%01d.%01d%c", (uint8_t)osdGForce, (uint8_t)(osdGForce * 10) % 10, "G");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue