-
Notifications
You must be signed in to change notification settings - Fork 43
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
Example PR for the example code #102
Conversation
// CLI access to the new parameter. | ||
// The VAR_ type must match the definition | ||
// Profile parameters also need PROFILE_VALUE | ||
{ "example_parameter", VAR_UINT16 | PROFILE_VALUE, .config.minmaxUnsigned = { 1, 2500 }, PG_PID_PROFILE, offsetof(pidProfile_t, example_parameter) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every CLI parameter needs a line like this.
@@ -174,6 +174,8 @@ typedef struct pidProfile_s { | |||
uint8_t cyclic_cross_coupling_ratio; | |||
uint8_t cyclic_cross_coupling_cutoff; | |||
|
|||
uint16_t example_parameter; // A new parameter in the profile | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the config storage for the parameter.
@@ -87,6 +87,7 @@ void resetPidProfile(pidProfile_t *pidProfile) | |||
.cyclic_cross_coupling_gain = 25, | |||
.cyclic_cross_coupling_ratio = 0, | |||
.cyclic_cross_coupling_cutoff = 15, | |||
.example_parameter = 100, // Default value for the new parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each parameter should have a default value defined.
@@ -120,6 +120,8 @@ typedef struct pid_s { | |||
|
|||
float collective; | |||
|
|||
float exampleFloat; // Active value to be used in PID | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually parameters are not used directly from the config storage variable, but copied to a local "runtime" variable.
This is important specifically with PID parameters.
Closing this. It can be still looked at. |
This is an example PR, for showing how the reviews are done.
NOT TO BE MERGED!