diff --git a/flight/modules/Airspeed/airspeed.c b/flight/modules/Airspeed/airspeed.c index d44682c98..d86a692a6 100644 --- a/flight/modules/Airspeed/airspeed.c +++ b/flight/modules/Airspeed/airspeed.c @@ -169,6 +169,8 @@ static void airspeedTask(__attribute__((unused)) void *parameters) imu_airspeedInitialize(&airspeedSettings); } break; + default: + break; } } switch (airspeedSettings.AirspeedSensorType) { diff --git a/flight/modules/PathFollower/vtolbrakecontroller.cpp b/flight/modules/PathFollower/vtolbrakecontroller.cpp index 625567887..141421e73 100644 --- a/flight/modules/PathFollower/vtolbrakecontroller.cpp +++ b/flight/modules/PathFollower/vtolbrakecontroller.cpp @@ -315,7 +315,7 @@ int8_t VtolBrakeController::UpdateStabilizationDesired(void) default: break; } - stabDesired.StabilizationMode.Thrust = thrustMode; + stabDesired.StabilizationMode.Thrust = (StabilizationDesiredStabilizationModeOptions) thrustMode; } // set the thrust value diff --git a/flight/modules/PathFollower/vtollandfsm.cpp b/flight/modules/PathFollower/vtollandfsm.cpp index 4dbbe63c1..b4aff11cd 100644 --- a/flight/modules/PathFollower/vtollandfsm.cpp +++ b/flight/modules/PathFollower/vtollandfsm.cpp @@ -390,7 +390,7 @@ void VtolLandFSM::run_init_althold(uint8_t flTimeout) { if (flTimeout) { mLandData->flAltitudeHold = false; - setState(LAND_STATE_WTG_FOR_DESCENTRATE, STATUSVTOLLAND_STATEEXITREASON_TIMEOUT); + setState(STATUSVTOLLAND_STATE_WTGFORDESCENTRATE, STATUSVTOLLAND_STATEEXITREASON_TIMEOUT); } } @@ -427,13 +427,13 @@ void VtolLandFSM::run_wtg_for_descentrate(uint8_t flTimeout) if (velocityState.Down > (LANDRATE_LOWLIMIT_FACTOR * mLandData->fsmLandStatus.targetDescentRate) && velocityState.Down < (LANDRATE_HILIMIT_FACTOR * mLandData->fsmLandStatus.targetDescentRate)) { if (mLandData->observationCount++ > WTG_FOR_DESCENTRATE_COUNT_LIMIT) { - setState(LAND_STATE_AT_DESCENTRATE, STATUSVTOLLAND_STATEEXITREASON_DESCENTRATEOK); + setState(STATUSVTOLLAND_STATE_ATDESCENTRATE, STATUSVTOLLAND_STATEEXITREASON_DESCENTRATEOK); return; } } if (flTimeout) { - setState(LAND_STATE_ABORT, STATUSVTOLLAND_STATEEXITREASON_TIMEOUT); + setState(STATUSVTOLLAND_STATE_ABORT, STATUSVTOLLAND_STATEEXITREASON_TIMEOUT); } } @@ -476,7 +476,7 @@ void VtolLandFSM::run_at_descentrate(uint8_t flTimeout) mLandData->fsmLandStatus.calculatedNeutralThrust = boundf(mLandData->fsmLandStatus.calculatedNeutralThrust, vtolPathFollowerSettings->ThrustLimits.Neutral, vtolPathFollowerSettings->ThrustLimits.Max); - setState(LAND_STATE_WTG_FOR_GROUNDEFFECT, STATUSVTOLLAND_STATEEXITREASON_DESCENTRATEOK); + setState(STATUSVTOLLAND_STATE_WTGFORGROUNDEFFECT, STATUSVTOLLAND_STATEEXITREASON_DESCENTRATEOK); } } @@ -534,7 +534,7 @@ void VtolLandFSM::run_wtg_for_groundeffect(__attribute__((unused)) uint8_t flTim if (flBounce || flBounceAccel) { mLandData->observation2Count++; if (mLandData->observation2Count > BOUNCE_TRIGGER_COUNT) { - setState(LAND_STATE_GROUNDEFFECT, (flBounce ? STATUSVTOLLAND_STATEEXITREASON_BOUNCEVELOCITY : STATUSVTOLLAND_STATEEXITREASON_BOUNCEACCEL)); + setState(STATUSVTOLLAND_STATE_GROUNDEFFECT, (flBounce ? STATUSVTOLLAND_STATEEXITREASON_BOUNCEVELOCITY : STATUSVTOLLAND_STATEEXITREASON_BOUNCEACCEL)); return; } } else { @@ -548,7 +548,7 @@ void VtolLandFSM::run_wtg_for_groundeffect(__attribute__((unused)) uint8_t flTim mLandData->observationCount++; if (mLandData->observationCount > GROUNDEFFECT_SLOWDOWN_COUNT) { #ifndef DEBUG_GROUNDIMPACT - setState(LAND_STATE_GROUNDEFFECT, STATUSVTOLLAND_STATEEXITREASON_LOWDESCENTRATE); + setState(STATUSVTOLLAND_STATE_GROUNDEFFECT, STATUSVTOLLAND_STATEEXITREASON_LOWDESCENTRATE); #endif return; } @@ -580,7 +580,7 @@ void VtolLandFSM::run_groundeffect(__attribute__((unused)) uint8_t flTimeout) StabilizationDesiredGet(&stabDesired); if (stabDesired.Thrust < 0.0f) { - setState(LAND_STATE_THRUSTOFF, STATUSVTOLLAND_STATEEXITREASON_ZEROTHRUST); + setState(STATUSVTOLLAND_STATE_THRUSTOFF, STATUSVTOLLAND_STATEEXITREASON_ZEROTHRUST); return; } @@ -597,12 +597,12 @@ void VtolLandFSM::run_groundeffect(__attribute__((unused)) uint8_t flTimeout) float east_error = mLandData->expectedLandPositionEast - positionState.East; float positionError = sqrtf(north_error * north_error + east_error * east_error); if (positionError > 0.3f) { - setState(LAND_STATE_THRUSTDOWN, STATUSVTOLLAND_STATEEXITREASON_POSITIONERROR); + setState(STATUSVTOLLAND_STATE_THRUSTDOWN, STATUSVTOLLAND_STATEEXITREASON_POSITIONERROR); return; } if (flTimeout) { - setState(LAND_STATE_THRUSTDOWN, STATUSVTOLLAND_STATEEXITREASON_TIMEOUT); + setState(STATUSVTOLLAND_STATE_THRUSTDOWN, STATUSVTOLLAND_STATEEXITREASON_TIMEOUT); } } @@ -628,11 +628,11 @@ void VtolLandFSM::run_thrustdown(__attribute__((unused)) uint8_t flTimeout) StabilizationDesiredData stabDesired; StabilizationDesiredGet(&stabDesired); if (stabDesired.Thrust < 0.0f || mLandData->thrustLimit < 0.0f) { - setState(LAND_STATE_THRUSTOFF, STATUSVTOLLAND_STATEEXITREASON_ZEROTHRUST); + setState(STATUSVTOLLAND_STATE_THRUSTOFF, STATUSVTOLLAND_STATEEXITREASON_ZEROTHRUST); } if (flTimeout) { - setState(LAND_STATE_THRUSTOFF, STATUSVTOLLAND_STATEEXITREASON_TIMEOUT); + setState(STATUSVTOLLAND_STATE_THRUSTOFF, STATUSVTOLLAND_STATEEXITREASON_TIMEOUT); } } @@ -647,7 +647,7 @@ void VtolLandFSM::setup_thrustoff(void) void VtolLandFSM::run_thrustoff(__attribute__((unused)) uint8_t flTimeout) { - setState(LAND_STATE_DISARMED, STATUSVTOLLAND_STATEEXITREASON_NONE); + setState(STATUSVTOLLAND_STATE_DISARMED, STATUSVTOLLAND_STATEEXITREASON_NONE); } // STATE: DISARMED @@ -665,7 +665,7 @@ void VtolLandFSM::run_disarmed(__attribute__((unused)) uint8_t flTimeout) { #ifdef DEBUG_GROUNDIMPACT if (mLandData->observationCount++ > 100) { - setState(LAND_STATE_WTG_FOR_GROUNDEFFECT, STATUSVTOLLAND_STATEEXITREASON_NONE); + setState(STATUSVTOLLAND_STATE_WTGFORGROUNDEFFECT, STATUSVTOLLAND_STATEEXITREASON_NONE); } #endif }