mc_pos_control: takeoff fix implicit switch fallthrough

This commit is contained in:
Daniel Agar
2019-08-28 09:13:26 -04:00
parent 5a5e15d384
commit aebf244464
2 changed files with 5 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ px4_add_module(
MODULE modules__mc_pos_control MODULE modules__mc_pos_control
MAIN mc_pos_control MAIN mc_pos_control
COMPILE_FLAGS COMPILE_FLAGS
-Wno-implicit-fallthrough # TODO: fix and remove
STACK_MAIN 1500 STACK_MAIN 1500
SRCS SRCS
mc_pos_control_main.cpp mc_pos_control_main.cpp

View File

@@ -58,6 +58,7 @@ void Takeoff::updateTakeoffState(const bool armed, const bool landed, const bool
break; break;
} }
// FALLTHROUGH
case TakeoffState::spoolup: case TakeoffState::spoolup:
if (_spoolup_time_hysteresis.get_state()) { if (_spoolup_time_hysteresis.get_state()) {
_takeoff_state = TakeoffState::ready_for_takeoff; _takeoff_state = TakeoffState::ready_for_takeoff;
@@ -66,6 +67,7 @@ void Takeoff::updateTakeoffState(const bool armed, const bool landed, const bool
break; break;
} }
// FALLTHROUGH
case TakeoffState::ready_for_takeoff: case TakeoffState::ready_for_takeoff:
if (want_takeoff) { if (want_takeoff) {
_takeoff_state = TakeoffState::rampup; _takeoff_state = TakeoffState::rampup;
@@ -75,6 +77,7 @@ void Takeoff::updateTakeoffState(const bool armed, const bool landed, const bool
break; break;
} }
// FALLTHROUGH
case TakeoffState::rampup: case TakeoffState::rampup:
if (_takeoff_ramp_vz >= takeoff_desired_vz) { if (_takeoff_ramp_vz >= takeoff_desired_vz) {
_takeoff_state = TakeoffState::flight; _takeoff_state = TakeoffState::flight;
@@ -83,6 +86,7 @@ void Takeoff::updateTakeoffState(const bool armed, const bool landed, const bool
break; break;
} }
// FALLTHROUGH
case TakeoffState::flight: case TakeoffState::flight:
if (landed) { if (landed) {
_takeoff_state = TakeoffState::ready_for_takeoff; _takeoff_state = TakeoffState::ready_for_takeoff;