Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copter: Consolidate processing #28313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

muramura
Copy link
Contributor

@muramura muramura commented Oct 5, 2024

I can consolidate processing by using a ternary operator.
The free space has increased by 8 bytes.

AFTER
BUILD SUMMARY
Build directory: /home/parallels/work2/ardupilot/build/fmuv3
Target Text (B) Data (B) BSS (B) Total Flash Used (B) Free Flash (B) External Flash Used (B)

bin/arducopter 1567697 3892 192868 1571589 509164 Not Applicable

BEFORE
BUILD SUMMARY
Build directory: /home/parallels/work2/ardupilot/build/fmuv3
Target Text (B) Data (B) BSS (B) Total Flash Used (B) Free Flash (B) External Flash Used (B)

bin/arducopter 1567705 3892 192868 1571597 509156 Not Applicable

@tpwrules
Copy link
Contributor

tpwrules commented Oct 5, 2024

Why not use fabsf?

@muramura
Copy link
Contributor Author

muramura commented Oct 5, 2024

@tpwrules san
By switching to fabsf, I freed up 24 bytes.

@peterbarker
Copy link
Contributor

This looks good. What testing has it had?

@muramura
Copy link
Contributor Author

muramura commented Oct 6, 2024

I confirmed that the values before and after the change are the same; they are indeed identical.

Screenshot from 2024-10-06 16-19-36

test code:
Screenshot from 2024-10-06 16-23-15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants