vtol/fw/mc: fix VTOL enum shadowing

This changes the enums used for various VTOL states to enum classes
which makes them type-safe and should avoid shadowing.

This change was motivated by a Clang warning about shadowing of the
enum const TRANSITION_TO_FW which was declared twice, once in
vtol_type.h and once in standard.h.

This change only removes the shadowing but presumably these enums could
be cleaned up and consolidated further.
This commit is contained in:
Julian Oes
2019-05-29 23:51:10 -04:00
committed by Daniel Agar
parent 4b3f68f90c
commit 2ac8841f35
10 changed files with 72 additions and 72 deletions
+4 -4
View File
@@ -151,24 +151,24 @@ void Tailsitter::update_vtol_state()
// map tailsitter specific control phases to simple control modes
switch (_vtol_schedule.flight_mode) {
case MC_MODE:
_vtol_mode = ROTARY_WING;
_vtol_mode = mode::ROTARY_WING;
_vtol_vehicle_status->vtol_in_trans_mode = false;
_flag_was_in_trans_mode = false;
break;
case FW_MODE:
_vtol_mode = FIXED_WING;
_vtol_mode = mode::FIXED_WING;
_vtol_vehicle_status->vtol_in_trans_mode = false;
_flag_was_in_trans_mode = false;
break;
case TRANSITION_FRONT_P1:
_vtol_mode = TRANSITION_TO_FW;
_vtol_mode = mode::TRANSITION_TO_FW;
_vtol_vehicle_status->vtol_in_trans_mode = true;
break;
case TRANSITION_BACK:
_vtol_mode = TRANSITION_TO_MC;
_vtol_mode = mode::TRANSITION_TO_MC;
_vtol_vehicle_status->vtol_in_trans_mode = true;
break;
}