Copter: send flight mode string to Notify

This commit is contained in:
Randy Mackay 2017-01-20 19:15:20 +09:00 committed by Lucas De Marchi
parent cb1d1df03a
commit 26919b4ab6
2 changed files with 62 additions and 1 deletions

View File

@ -362,6 +362,67 @@ void Copter::notify_flight_mode(control_mode_t mode)
AP_Notify::flags.autopilot_mode = false;
break;
}
// set flight mode string
switch (mode) {
case STABILIZE:
notify.set_flight_mode_str("STAB");
break;
case ACRO:
notify.set_flight_mode_str("ACRO");
break;
case ALT_HOLD:
notify.set_flight_mode_str("ALTH");
break;
case AUTO:
notify.set_flight_mode_str("AUTO");
break;
case GUIDED:
notify.set_flight_mode_str("GUID");
break;
case LOITER:
notify.set_flight_mode_str("LOIT");
break;
case RTL:
notify.set_flight_mode_str("RTL ");
break;
case CIRCLE:
notify.set_flight_mode_str("CIRC");
break;
case LAND:
notify.set_flight_mode_str("LAND");
break;
case DRIFT:
notify.set_flight_mode_str("DRIF");
break;
case SPORT:
notify.set_flight_mode_str("SPRT");
break;
case FLIP:
notify.set_flight_mode_str("FLIP");
break;
case AUTOTUNE:
notify.set_flight_mode_str("ATUN");
break;
case POSHOLD:
notify.set_flight_mode_str("PHLD");
break;
case BRAKE:
notify.set_flight_mode_str("BRAK");
break;
case THROW:
notify.set_flight_mode_str("THRW");
break;
case AVOID_ADSB:
notify.set_flight_mode_str("AVOI");
break;
case GUIDED_NOGPS:
notify.set_flight_mode_str("GNGP");
break;
default:
notify.set_flight_mode_str("----");
break;
}
}
//

View File

@ -134,8 +134,8 @@ void Copter::init_ardupilot()
#endif
// initialise notify system
// disable external leds if epm is enabled because of pin conflict on the APM
notify.init(true);
notify_flight_mode(control_mode);
// initialise battery monitor
battery.init();