1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 17:25:18 +03:00

Update fc_msp_box.c

This commit is contained in:
breadoven 2021-12-24 23:43:33 +00:00
parent 9a48088952
commit 3a5a3c0ada

View file

@ -199,20 +199,15 @@ void initActiveBoxIds(void)
activeBoxIds[activeBoxIdCount++] = BOXFPVANGLEMIX;
}
bool navReadyAltControl = false;
if (sensors(SENSOR_BARO)) {
navReadyAltControl = true;
}
bool navReadyAltControl = sensors(SENSOR_BARO);
#ifdef USE_GPS
if ((feature(FEATURE_GPS) && (STATE(AIRPLANE) || positionEstimationConfig()->use_gps_no_baro))) {
navReadyAltControl = true;
}
navReadyAltControl = navReadyAltControl || (feature(FEATURE_GPS) && (STATE(AIRPLANE) || positionEstimationConfig()->use_gps_no_baro));
const bool navFlowDeadReckoning = sensors(SENSOR_OPFLOW) && sensors(SENSOR_ACC) && positionEstimationConfig()->allow_dead_reckoning;
bool navReadyPosControl = sensors(SENSOR_ACC) && feature(FEATURE_GPS);
if (STATE(MULTIROTOR)) {
navReadyPosControl = navReadyPosControl && getHwCompassStatus() != HW_SENSOR_NONE;
}
const bool navFlowDeadReckoning = sensors(SENSOR_OPFLOW) && sensors(SENSOR_ACC) && positionEstimationConfig()->allow_dead_reckoning;
if (STATE(ALTITUDE_CONTROL) && navReadyAltControl && (navReadyPosControl || navFlowDeadReckoning)) {
activeBoxIds[activeBoxIdCount++] = BOXNAVPOSHOLD;
@ -228,12 +223,10 @@ void initActiveBoxIds(void)
activeBoxIds[activeBoxIdCount++] = BOXHOMERESET;
activeBoxIds[activeBoxIdCount++] = BOXGCSNAV;
activeBoxIds[activeBoxIdCount++] = BOXPLANWPMISSION;
if (STATE(AIRPLANE)) {
activeBoxIds[activeBoxIdCount++] = BOXNAVCRUISE;
}
}
if (STATE(AIRPLANE)) {
activeBoxIds[activeBoxIdCount++] = BOXNAVCRUISE;
activeBoxIds[activeBoxIdCount++] = BOXNAVCOURSEHOLD;
activeBoxIds[activeBoxIdCount++] = BOXSOARING;
}