Skip to content

Commit

Permalink
ArduCopter: make bad-mode-number notification consistent across vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and rmackay9 committed Sep 1, 2021
1 parent 7a06c94 commit 2d02396
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ArduCopter/mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,9 @@ bool Copter::set_mode(Mode::Number mode, ModeReason reason)
}
#endif

Mode *new_flightmode = mode_from_mode_num((Mode::Number)mode);
Mode *new_flightmode = mode_from_mode_num(mode);
if (new_flightmode == nullptr) {
gcs().send_text(MAV_SEVERITY_WARNING,"No such mode");
AP::logger().Write_Error(LogErrorSubsystem::FLIGHT_MODE, LogErrorCode(mode));
notify_no_such_mode((uint8_t)mode);
return false;
}

Expand Down

0 comments on commit 2d02396

Please sign in to comment.