Remove unused modes.
This commit is contained in:
parent
7d56929ffa
commit
017bdca593
|
@ -38,7 +38,6 @@ typedef enum {
|
|||
BOXGPSHOLD,
|
||||
BOXHEADFREE,
|
||||
BOXPASSTHRU,
|
||||
BOXRANGEFINDER,
|
||||
BOXFAILSAFE,
|
||||
BOXGPSRESCUE,
|
||||
BOXID_FLIGHTMODE_LAST = BOXGPSRESCUE,
|
||||
|
@ -49,16 +48,11 @@ typedef enum {
|
|||
BOXANTIGRAVITY,
|
||||
BOXHEADADJ,
|
||||
BOXCAMSTAB,
|
||||
BOXCAMTRIG,
|
||||
BOXBEEPERON,
|
||||
BOXLEDMAX,
|
||||
BOXLEDLOW,
|
||||
BOXLLIGHTS,
|
||||
BOXCALIB,
|
||||
BOXGOV,
|
||||
BOXOSD,
|
||||
BOXTELEMETRY,
|
||||
BOXGTUNE,
|
||||
BOXSERVO1,
|
||||
BOXSERVO2,
|
||||
BOXSERVO3,
|
||||
|
|
|
@ -77,9 +77,9 @@ typedef enum {
|
|||
GPS_HOME_MODE = (1 << 4),
|
||||
GPS_HOLD_MODE = (1 << 5),
|
||||
HEADFREE_MODE = (1 << 6),
|
||||
UNUSED_MODE = (1 << 7), // old autotune
|
||||
// UNUSED_MODE = (1 << 7), // old autotune
|
||||
PASSTHRU_MODE = (1 << 8),
|
||||
RANGEFINDER_MODE= (1 << 9),
|
||||
// RANGEFINDER_MODE= (1 << 9),
|
||||
FAILSAFE_MODE = (1 << 10),
|
||||
GPS_RESCUE_MODE = (1 << 11)
|
||||
} flightModeFlags_e;
|
||||
|
@ -101,7 +101,6 @@ extern uint16_t flightModeFlags;
|
|||
[BOXGPSHOLD] = LOG2( GPS_HOLD_MODE), \
|
||||
[BOXHEADFREE] = LOG2(HEADFREE_MODE), \
|
||||
[BOXPASSTHRU] = LOG2(PASSTHRU_MODE), \
|
||||
[BOXRANGEFINDER] = LOG2(RANGEFINDER_MODE), \
|
||||
[BOXFAILSAFE] = LOG2(FAILSAFE_MODE), \
|
||||
[BOXGPSRESCUE] = LOG2(GPS_RESCUE_MODE), \
|
||||
} \
|
||||
|
|
|
@ -56,20 +56,20 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT] = {
|
|||
{ BOXHEADFREE, "HEADFREE", 6 },
|
||||
{ BOXHEADADJ, "HEADADJ", 7 },
|
||||
{ BOXCAMSTAB, "CAMSTAB", 8 },
|
||||
{ BOXCAMTRIG, "CAMTRIG", 9 },
|
||||
// { BOXCAMTRIG, "CAMTRIG", 9 },
|
||||
{ BOXGPSHOME, "GPS HOME", 10 },
|
||||
{ BOXGPSHOLD, "GPS HOLD", 11 },
|
||||
{ BOXPASSTHRU, "PASSTHRU", 12 },
|
||||
{ BOXBEEPERON, "BEEPER", 13 },
|
||||
{ BOXLEDMAX, "LEDMAX", 14 },
|
||||
// { BOXLEDMAX, "LEDMAX", 14 }, (removed)
|
||||
{ BOXLEDLOW, "LEDLOW", 15 },
|
||||
{ BOXLLIGHTS, "LLIGHTS", 16 },
|
||||
// { BOXLLIGHTS, "LLIGHTS", 16 }, (removed)
|
||||
{ BOXCALIB, "CALIB", 17 },
|
||||
{ BOXGOV, "GOVERNOR", 18 },
|
||||
// { BOXGOV, "GOVERNOR", 18 }, (removed)
|
||||
{ BOXOSD, "OSD DISABLE SW", 19 },
|
||||
{ BOXTELEMETRY, "TELEMETRY", 20 },
|
||||
{ BOXGTUNE, "GTUNE", 21 },
|
||||
{ BOXRANGEFINDER, "RANGEFINDER", 22 },
|
||||
// { BOXGTUNE, "GTUNE", 21 }, (removed)
|
||||
// { BOXRANGEFINDER, "RANGEFINDER", 22 }, (removed)
|
||||
{ BOXSERVO1, "SERVO1", 23 },
|
||||
{ BOXSERVO2, "SERVO2", 24 },
|
||||
{ BOXSERVO3, "SERVO3", 25 },
|
||||
|
@ -198,12 +198,6 @@ void initActiveBoxIds(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_RANGEFINDER
|
||||
if (feature(FEATURE_RANGEFINDER)) { // XXX && sensors(SENSOR_RANGEFINDER)?
|
||||
BME(BOXRANGEFINDER);
|
||||
}
|
||||
#endif
|
||||
|
||||
BME(BOXFAILSAFE);
|
||||
|
||||
if (mixerConfig()->mixerMode == MIXER_FLYING_WING || mixerConfig()->mixerMode == MIXER_AIRPLANE || mixerConfig()->mixerMode == MIXER_CUSTOM_AIRPLANE) {
|
||||
|
|
|
@ -159,20 +159,14 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = {
|
|||
{ BOXHEADFREE, "HEADFREE;", 6 },
|
||||
{ BOXHEADADJ, "HEADADJ;", 7 },
|
||||
{ BOXCAMSTAB, "CAMSTAB;", 8 },
|
||||
{ BOXCAMTRIG, "CAMTRIG;", 9 },
|
||||
{ BOXGPSHOME, "GPS HOME;", 10 },
|
||||
{ BOXGPSHOLD, "GPS HOLD;", 11 },
|
||||
{ BOXPASSTHRU, "PASSTHRU;", 12 },
|
||||
{ BOXBEEPERON, "BEEPER;", 13 },
|
||||
{ BOXLEDMAX, "LEDMAX;", 14 },
|
||||
{ BOXLEDLOW, "LEDLOW;", 15 },
|
||||
{ BOXLLIGHTS, "LLIGHTS;", 16 },
|
||||
{ BOXCALIB, "CALIB;", 17 },
|
||||
{ BOXGOV, "GOVERNOR;", 18 },
|
||||
{ BOXOSD, "OSD DISABLE SW;", 19 },
|
||||
{ BOXTELEMETRY, "TELEMETRY;", 20 },
|
||||
{ BOXGTUNE, "GTUNE;", 21 },
|
||||
{ BOXRANGEFINDER, "RANGEFINDER;", 22 },
|
||||
{ BOXSERVO1, "SERVO1;", 23 },
|
||||
{ BOXSERVO2, "SERVO2;", 24 },
|
||||
{ BOXSERVO3, "SERVO3;", 25 },
|
||||
|
@ -305,20 +299,14 @@ static bool bstSlaveProcessFeedbackCommand(uint8_t bstRequest)
|
|||
IS_ENABLED(FLIGHT_MODE(HEADFREE_MODE)) << BOXHEADFREE |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXHEADADJ)) << BOXHEADADJ |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXCAMSTAB)) << BOXCAMSTAB |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXCAMTRIG)) << BOXCAMTRIG |
|
||||
IS_ENABLED(FLIGHT_MODE(GPS_HOME_MODE)) << BOXGPSHOME |
|
||||
IS_ENABLED(FLIGHT_MODE(GPS_HOLD_MODE)) << BOXGPSHOLD |
|
||||
IS_ENABLED(FLIGHT_MODE(PASSTHRU_MODE)) << BOXPASSTHRU |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBEEPERON)) << BOXBEEPERON |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLEDMAX)) << BOXLEDMAX |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLEDLOW)) << BOXLEDLOW |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLLIGHTS)) << BOXLLIGHTS |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXCALIB)) << BOXCALIB |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXGOV)) << BOXGOV |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXOSD)) << BOXOSD |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXTELEMETRY)) << BOXTELEMETRY |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXGTUNE)) << BOXGTUNE |
|
||||
IS_ENABLED(FLIGHT_MODE(RANGEFINDER_MODE)) << BOXRANGEFINDER |
|
||||
IS_ENABLED(ARMING_FLAG(ARMED)) << BOXARM |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBLACKBOX)) << BOXBLACKBOX |
|
||||
IS_ENABLED(FLIGHT_MODE(FAILSAFE_MODE)) << BOXFAILSAFE;
|
||||
|
@ -878,7 +866,6 @@ bool writeFCModeToBST(void)
|
|||
IS_ENABLED(FLIGHT_MODE(BARO_MODE)) << 3 |
|
||||
IS_ENABLED(FLIGHT_MODE(MAG_MODE)) << 4 |
|
||||
IS_ENABLED(IS_RC_MODE_ACTIVE(BOXAIRMODE)) << 5 |
|
||||
IS_ENABLED(FLIGHT_MODE(RANGEFINDER_MODE)) << 6 |
|
||||
IS_ENABLED(FLIGHT_MODE(FAILSAFE_MODE)) << 7;
|
||||
|
||||
bstMasterStartBuffer(PUBLIC_ADDRESS);
|
||||
|
|
|
@ -491,12 +491,15 @@ void mavlinkSendHUDAndHeartbeat(void)
|
|||
mavCustomMode = 0; //Stabilize
|
||||
mavModes |= MAV_MODE_FLAG_STABILIZE_ENABLED;
|
||||
}
|
||||
if (FLIGHT_MODE(BARO_MODE) || FLIGHT_MODE(RANGEFINDER_MODE))
|
||||
if (FLIGHT_MODE(BARO_MODE)) {
|
||||
mavCustomMode = 2; //Alt Hold
|
||||
if (FLIGHT_MODE(GPS_HOME_MODE))
|
||||
}
|
||||
if (FLIGHT_MODE(GPS_HOME_MODE)) {
|
||||
mavCustomMode = 6; //Return to Launch
|
||||
if (FLIGHT_MODE(GPS_HOLD_MODE))
|
||||
}
|
||||
if (FLIGHT_MODE(GPS_HOLD_MODE)) {
|
||||
mavCustomMode = 16; //Position Hold (Earlier called Hybrid)
|
||||
}
|
||||
|
||||
uint8_t mavSystemState = 0;
|
||||
if (ARMING_FLAG(ARMED)) {
|
||||
|
|
|
@ -676,31 +676,36 @@ void processSmartPortTelemetry(smartPortPayload_t *payload, volatile bool *clear
|
|||
} else {
|
||||
tmpi += 2;
|
||||
}
|
||||
if (ARMING_FLAG(ARMED))
|
||||
if (ARMING_FLAG(ARMED)) {
|
||||
tmpi += 4;
|
||||
}
|
||||
|
||||
if (FLIGHT_MODE(ANGLE_MODE))
|
||||
if (FLIGHT_MODE(ANGLE_MODE)) {
|
||||
tmpi += 10;
|
||||
if (FLIGHT_MODE(HORIZON_MODE))
|
||||
}
|
||||
if (FLIGHT_MODE(HORIZON_MODE)) {
|
||||
tmpi += 20;
|
||||
if (FLIGHT_MODE(UNUSED_MODE))
|
||||
tmpi += 40;
|
||||
if (FLIGHT_MODE(PASSTHRU_MODE))
|
||||
}
|
||||
if (FLIGHT_MODE(PASSTHRU_MODE)) {
|
||||
tmpi += 40;
|
||||
}
|
||||
|
||||
if (FLIGHT_MODE(MAG_MODE))
|
||||
if (FLIGHT_MODE(MAG_MODE)) {
|
||||
tmpi += 100;
|
||||
if (FLIGHT_MODE(BARO_MODE))
|
||||
}
|
||||
if (FLIGHT_MODE(BARO_MODE)) {
|
||||
tmpi += 200;
|
||||
if (FLIGHT_MODE(RANGEFINDER_MODE))
|
||||
tmpi += 400;
|
||||
}
|
||||
|
||||
if (FLIGHT_MODE(GPS_HOLD_MODE))
|
||||
if (FLIGHT_MODE(GPS_HOLD_MODE)) {
|
||||
tmpi += 1000;
|
||||
if (FLIGHT_MODE(GPS_HOME_MODE))
|
||||
}
|
||||
if (FLIGHT_MODE(GPS_HOME_MODE)) {
|
||||
tmpi += 2000;
|
||||
if (FLIGHT_MODE(HEADFREE_MODE))
|
||||
}
|
||||
if (FLIGHT_MODE(HEADFREE_MODE)) {
|
||||
tmpi += 4000;
|
||||
}
|
||||
|
||||
smartPortSendPackage(id, (uint32_t)tmpi);
|
||||
*clearToSend = false;
|
||||
|
|
Loading…
Reference in New Issue