Revise code generation for parameters#1002
Open
bocchino wants to merge 42 commits into
Open
Conversation
This reverts commit 7bb0d32.
Kronos3
approved these changes
May 13, 2026
Collaborator
Kronos3
left a comment
There was a problem hiding this comment.
I think this codegen looks good though we may want to revisit the use of the scratch buffer instead of stack buffer in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #984.
Tandem with https://github.com/bocchino/fprime/tree/fpp-issue-984-extern-param-defaults.
Implementation Note
In the old code for loading external parameters, if there was no valid value to send to the external parameter interface, the interface was never called. In the new code, the interface is called with an INVALID flag argument. The new behavior provides more information to the external interface. However, the external interface will need to respect the rule that if it is called with an INVALID flag argument, then the data buffer does not contain valid data.
Review Notes
The diff of the C++ output for the component base classes may be hard to review. Here is a simple model that illustrates the new code generation strategy:
You can run this model through
fpp-to-cppto see the four cases: internal parameter with default, external parameter with default, internal parameter with no default, and external parameter with no default.