Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current method we're using for backward compatibility is very limited. This PR implements configurator style backward compatibility and builds further on common page logic.
This makes it very easy for us to add or remove parameters and still have the script be fully compatible with older versions of betaflight.
The exact same layout is now used for all radios. Templates are now used. Each screen resolution has it's own templates. Currently there's only a default template for each resolution which works fine for all the pages. It's possible to add a custom template for each page and resolution if needed. Just create the file and the page will use it instead of the default template.
This limits what we can do with the layouts but it makes everything much easier. We don't have to manually edit 1 million coordinates anymore. Just add the new parameter whereever in a page and that's it.
PageFiles
have been reworked. It now returns a table created based onapiVersion
. Since we're now doing a forcedapiVersion
detection,PageFiles
will only contain compatible pages. This eliminates the need for multipleapiVersion/requiredVersion
checks spread throughout the code.This also eliminates some bugs. Currently if a page is to be skipped because of
requiredVersion
we can end up with a broken main menu. Also if a page is skipped it's not possible to go back a page. These changes fixes all of that.Memory use is the same or maybe a little less than before.
Did some changes to the PWM page functions. Creating tables everytime the page is drawn is very inefficient and can lead to huge memory spikes when changing values. Now empty tables are created when the page is loaded. The contents of the tables are now just overwritten instead of creating new ones. Reduces memory use quite a bit for this page.
If anyone wants to try this:
betaflight-tx-lua-scripts.zip