Skip to content

Commit

Permalink
Rover: 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 ac05a66 commit 591c7d5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Rover/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ bool Rover::set_mode(const uint8_t new_mode, ModeReason reason)
static_assert(sizeof(Mode::Number) == sizeof(new_mode), "The new mode can't be mapped to the vehicles mode number");
Mode *mode = rover.mode_from_mode_num((enum Mode::Number)new_mode);
if (mode == nullptr) {
notify_no_such_mode(new_mode);
return false;
}
return rover.set_mode(*mode, reason);
Expand Down

0 comments on commit 591c7d5

Please sign in to comment.