1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

compact the posHoldUpdate() function - thanks K

This commit is contained in:
ctzsnooze 2024-10-18 23:06:39 +11:00
parent 5b2f209074
commit c39b6ab06e
4 changed files with 8 additions and 16 deletions

View file

@ -305,7 +305,7 @@ bool positionControl(bool useStickAdjustment, float deadband) {
} else if (deltaHeading < -180.0f) {
deltaHeading += 360.0f; // Wrap around if less than -180
}
float deltaHeadingRadians = deltaHeading * (M_PIf / 180.0f); // Convert to radians
float deltaHeadingRadians = deltaHeading * RAD; // Convert to radians
float cosDeltaHeading = cos_approx(deltaHeadingRadians);
float sinDeltaHeading = sin_approx(deltaHeadingRadians);