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

AP_Scripting: use helper for not supported error saving 1K of flash #16644

Merged
merged 1 commit into from
Feb 18, 2021

Conversation

IamPete1
Copy link
Member

To make up for #13753 this adds a helper function that saves ~1K (1080) of flash. This is due to cutting down the length of similar strings. I did also try the same with the %s out of range string but that is not a net saving (I guess due to the way the compiler merges constants or something?).

Copy link
Contributor

@amilcarlucas amilcarlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this adds code, but reduces binary size? Nice!

Copy link
Contributor

@WickedShell WickedShell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I agree, this was on the list of things to eventually revisit, just some implementation details to clean up first.

libraries/AP_Scripting/generator/src/main.c Outdated Show resolved Hide resolved
libraries/AP_Scripting/generator/src/main.c Outdated Show resolved Hide resolved
@WickedShell
Copy link
Contributor

Was this actually tested on real hardware/sitl somewhere? The normal autotests won't test this for us.

@IamPete1
Copy link
Member Author

Yeah, tested in SITL with LED:get_rgb() in the REPL.

@WickedShell WickedShell merged commit bf7920f into ArduPilot:master Feb 18, 2021
@WickedShell
Copy link
Contributor

Great, thanks.

@IamPete1 IamPete1 deleted the scr_flash_helper branch February 19, 2021 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants