1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Reduce ITCM RAM footprint considerably

This commit is contained in:
ctzsnooze 2024-11-28 13:22:50 +11:00
parent 1b12a7c76e
commit 3f823c7c6b

View file

@ -54,8 +54,8 @@ float sin_approx(float x)
{
// Wrap angle to 2π with range [-π π]
x = fmodf(x, 2.0f * M_PIf);
if (x <= -M_PIf) x += 2.0f * M_PIf;
if (x > M_PIf) x -= 2.0f * M_PIf;
while (x > M_PIf) x -= (2.0f * M_PIf); // always wrap input angle to -PI..PI
while (x < -M_PIf) x += (2.0f * M_PIf);
// Use axis symmetry around x = ±π/2 for polynomial outside of range [-π/2 π/2]
if (x > M_PIf / 2) {