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

Plane: match cork() and push() #28825

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ArduPlane/Plane.h
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ class Plane : public AP_Vehicle {
void dspoiler_update(void);
void airbrake_update(void);
void landing_neutral_control_surface_servos(void);
void servos_output(void);
void servos_output(bool cork = true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for this. It's not my area but it might be safer to remove the default from the argument and force the caller to make a choice.. maybe add a comment to help them make the choice. Just an idea though

Copy link
Member

Choose a reason for hiding this comment

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

I agree, the default hides the other users (here on github anyway) which are important to understand the scope of the change.

void servos_auto_trim(void);
void servos_twin_engine_mix();
void force_flare();
Expand Down
8 changes: 5 additions & 3 deletions ArduPlane/servos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ void Plane::set_servos(void)
#endif // AP_ICENGINE_ENABLED

// run output mixer and send values to the hal for output
servos_output();
servos_output(false);
}

/*
Expand Down Expand Up @@ -1017,10 +1017,12 @@ void Plane::indicate_waiting_for_rud_neutral_to_takeoff(void)
for each channel and calculates PWM values, then pushes them to
hal.rcout
*/
void Plane::servos_output(void)
void Plane::servos_output(bool cork)
{
auto &srv = AP::srv();
srv.cork();
if (cork) {
srv.cork();
}

// support twin-engine aircraft
servos_twin_engine_mix();
Expand Down
Loading