Skip to content

Commit

Permalink
AP_TECS: Don't fetch the land slewrate if it's not needed
Browse files Browse the repository at this point in the history
Co-authored-by: WickedShell <[email protected]>
  • Loading branch information
magicrub and WickedShell committed Jul 31, 2020
1 parent bbe01ad commit 8ae34a1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libraries/AP_TECS/AP_TECS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,11 @@ void AP_TECS::_update_throttle_with_airspeed(void)
// Rate limit PD + FF throttle
// Calculate the throttle increment from the specified slew time
int8_t throttle_slewrate = aparm.throttle_slewrate;
int8_t land_slewrate = _landing.get_throttle_slewrate();

if (_landing.is_on_approach() && land_slewrate >0) {
throttle_slewrate = land_slewrate;
if (_landing.is_on_approach()) {
const int8_t land_slewrate = _landing.get_throttle_slewrate();
if (land_slewrate > 0) {
throttle_slewrate = land_slewrate;
}
}

if (throttle_slewrate != 0) {
Expand Down

0 comments on commit 8ae34a1

Please sign in to comment.