Merge pull request #865 from TheAngularity/patch-1

rearrange boxes and fixed unused boxes not disabled
This commit is contained in:
Anton Stålheim 2016-08-01 18:20:38 +02:00 committed by GitHub
commit 78739a3911
1 changed files with 47 additions and 35 deletions

View File

@ -471,16 +471,15 @@ void mspInit(serialConfig_t *serialConfig)
activeBoxIdCount = 0;
activeBoxIds[activeBoxIdCount++] = BOXARM;
if (!feature(FEATURE_AIRMODE)) {
activeBoxIds[activeBoxIdCount++] = BOXAIRMODE;
}
if (sensors(SENSOR_ACC)) {
activeBoxIds[activeBoxIdCount++] = BOXANGLE;
activeBoxIds[activeBoxIdCount++] = BOXHORIZON;
}
if (!feature(FEATURE_AIRMODE)) activeBoxIds[activeBoxIdCount++] = BOXAIRMODE;
activeBoxIds[activeBoxIdCount++] = BOX3DDISABLESWITCH;
activeBoxIds[activeBoxIdCount++] = BOXFPVANGLEMIX;
if (sensors(SENSOR_BARO)) {
activeBoxIds[activeBoxIdCount++] = BOXBARO;
}
@ -491,9 +490,6 @@ void mspInit(serialConfig_t *serialConfig)
activeBoxIds[activeBoxIdCount++] = BOXHEADADJ;
}
if (feature(FEATURE_SERVO_TILT))
activeBoxIds[activeBoxIdCount++] = BOXCAMSTAB;
#ifdef GPS
if (feature(FEATURE_GPS)) {
activeBoxIds[activeBoxIdCount++] = BOXGPSHOME;
@ -501,8 +497,19 @@ void mspInit(serialConfig_t *serialConfig)
}
#endif
if (masterConfig.mixerMode == MIXER_FLYING_WING || masterConfig.mixerMode == MIXER_AIRPLANE)
#ifdef SONAR
if (feature(FEATURE_SONAR)) {
activeBoxIds[activeBoxIdCount++] = BOXSONAR;
}
#endif
if (feature(FEATURE_FAILSAFE)) {
activeBoxIds[activeBoxIdCount++] = BOXFAILSAFE;
}
if (masterConfig.mixerMode == MIXER_FLYING_WING || masterConfig.mixerMode == MIXER_AIRPLANE) {
activeBoxIds[activeBoxIdCount++] = BOXPASSTHRU;
}
activeBoxIds[activeBoxIdCount++] = BOXBEEPERON;
@ -512,21 +519,40 @@ void mspInit(serialConfig_t *serialConfig)
}
#endif
if (feature(FEATURE_INFLIGHT_ACC_CAL))
activeBoxIds[activeBoxIdCount++] = BOXCALIB;
#ifdef BLACKBOX
if (feature(FEATURE_BLACKBOX)) {
activeBoxIds[activeBoxIdCount++] = BOXBLACKBOX;
}
#endif
activeBoxIds[activeBoxIdCount++] = BOXOSD;
activeBoxIds[activeBoxIdCount++] = BOXFPVANGLEMIX;
if (feature(FEATURE_3D)) {
activeBoxIds[activeBoxIdCount++] = BOX3DDISABLESWITCH;
}
if (feature(FEATURE_SERVO_TILT)) {
activeBoxIds[activeBoxIdCount++] = BOXCAMSTAB;
}
if (feature(FEATURE_INFLIGHT_ACC_CAL)) {
activeBoxIds[activeBoxIdCount++] = BOXCALIB;
}
if (feature(FEATURE_OSD)) {
activeBoxIds[activeBoxIdCount++] = BOXOSD;
}
#ifdef TELEMETRY
if (feature(FEATURE_TELEMETRY) && masterConfig.telemetryConfig.telemetry_switch)
if (feature(FEATURE_TELEMETRY) && masterConfig.telemetryConfig.telemetry_switch) {
activeBoxIds[activeBoxIdCount++] = BOXTELEMETRY;
#endif
#ifdef SONAR
if (feature(FEATURE_SONAR)){
activeBoxIds[activeBoxIdCount++] = BOXSONAR;
}
#endif
#ifdef GTUNE
activeBoxIds[activeBoxIdCount++] = BOXGTUNE;
#endif
#ifdef USE_SERVOS
if (masterConfig.mixerMode == MIXER_CUSTOM_AIRPLANE) {
activeBoxIds[activeBoxIdCount++] = BOXSERVO1;
@ -535,20 +561,6 @@ void mspInit(serialConfig_t *serialConfig)
}
#endif
#ifdef BLACKBOX
if (feature(FEATURE_BLACKBOX)){
activeBoxIds[activeBoxIdCount++] = BOXBLACKBOX;
}
#endif
if (feature(FEATURE_FAILSAFE)){
activeBoxIds[activeBoxIdCount++] = BOXFAILSAFE;
}
#ifdef GTUNE
activeBoxIds[activeBoxIdCount++] = BOXGTUNE;
#endif
memset(mspPorts, 0x00, sizeof(mspPorts));
mspAllocateSerialPorts(serialConfig);
}