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:
parent
5b2f209074
commit
c39b6ab06e
4 changed files with 8 additions and 16 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue