1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 09:45:33 +03:00

Update fc_msp_box.c

This commit is contained in:
breadoven 2021-11-14 17:06:00 +00:00
parent f1182cdbb2
commit a2a54c1877

View file

@ -185,24 +185,31 @@ void initActiveBoxIds(void)
activeBoxIds[activeBoxIdCount++] = BOXHEADINGHOLD;
if (sensors(SENSOR_ACC) || sensors(SENSOR_MAG)) {
if (STATE(MULTIROTOR)) {
if ((sensors(SENSOR_ACC) || sensors(SENSOR_MAG))) {
activeBoxIds[activeBoxIdCount++] = BOXHEADFREE;
activeBoxIds[activeBoxIdCount++] = BOXHEADADJ;
}
if (STATE(ALTITUDE_CONTROL)) {
if (sensors(SENSOR_BARO) && sensors(SENSOR_RANGEFINDER) && sensors(SENSOR_OPFLOW)) {
activeBoxIds[activeBoxIdCount++] = BOXSURFACE;
}
activeBoxIds[activeBoxIdCount++] = BOXFPVANGLEMIX;
}
//Camstab mode is enabled always
activeBoxIds[activeBoxIdCount++] = BOXCAMSTAB;
#ifdef USE_GPS
if (STATE(ALTITUDE_CONTROL) && (sensors(SENSOR_BARO) || (feature(FEATURE_GPS) && (STATE(AIRPLANE) || positionEstimationConfig()->use_gps_no_baro)))) {
bool readyAltControl = false;
if (STATE(ALTITUDE_CONTROL) && sensors(SENSOR_BARO)) {
activeBoxIds[activeBoxIdCount++] = BOXNAVALTHOLD;
activeBoxIds[activeBoxIdCount++] = BOXSURFACE;
readyAltControl = true;
#ifdef USE_GPS
} else if ((feature(FEATURE_GPS) && STATE(AIRPLANE) && positionEstimationConfig()->use_gps_no_baro)) {
activeBoxIds[activeBoxIdCount++] = BOXNAVALTHOLD;
readyAltControl = true;
}
if (readyAltControl) {
const bool navReadyMultirotor = STATE(MULTIROTOR) && (getHwCompassStatus() != HW_SENSOR_NONE) && sensors(SENSOR_ACC) && feature(FEATURE_GPS);
const bool navReadyOther = !STATE(MULTIROTOR) && sensors(SENSOR_ACC) && feature(FEATURE_GPS);
const bool navFlowDeadReckoning = sensors(SENSOR_OPFLOW) && sensors(SENSOR_ACC) && positionEstimationConfig()->allow_dead_reckoning;
@ -234,8 +241,8 @@ void initActiveBoxIds(void)
activeBoxIds[activeBoxIdCount++] = BOXBRAKING;
}
#endif
#endif
#endif // GPS
}
if (STATE(AIRPLANE) || STATE(ROVER) || STATE(BOAT)) {
activeBoxIds[activeBoxIdCount++] = BOXMANUAL;