mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
Plane: added CLI_ENABLED option
this disables using CLI by default, even if compiled in. This is needed to make standard firmwares work well with companion computers where the CLI may cause startup issues
This commit is contained in:
parent
d9950ea07f
commit
16cdf64d63
@ -1674,7 +1674,7 @@ static void gcs_update(void)
|
||||
for (uint8_t i=0; i<num_gcs; i++) {
|
||||
if (gcs[i].initialised) {
|
||||
#if CLI_ENABLED == ENABLED
|
||||
gcs[i].update(run_cli);
|
||||
gcs[i].update(g.cli_enabled==1?run_cli:NULL);
|
||||
#else
|
||||
gcs[i].update(NULL);
|
||||
#endif
|
||||
|
@ -131,6 +131,7 @@ public:
|
||||
k_param_override_channel,
|
||||
k_param_stall_prevention,
|
||||
k_param_optflow,
|
||||
k_param_cli_enabled,
|
||||
|
||||
// 100: Arming parameters
|
||||
k_param_arming = 100,
|
||||
@ -320,6 +321,9 @@ public:
|
||||
AP_Int16 sysid_this_mav;
|
||||
AP_Int16 sysid_my_gcs;
|
||||
AP_Int8 telem_delay;
|
||||
#if CLI_ENABLED == ENABLED
|
||||
AP_Int8 cli_enabled;
|
||||
#endif
|
||||
|
||||
#if HIL_MODE != HIL_MODE_DISABLED
|
||||
AP_Float hil_err_limit;
|
||||
|
@ -38,6 +38,15 @@ const AP_Param::Info var_info[] PROGMEM = {
|
||||
// @User: Advanced
|
||||
GSCALAR(sysid_my_gcs, "SYSID_MYGCS", 255),
|
||||
|
||||
#if CLI_ENABLED == ENABLED
|
||||
// @Param: CLI_ENABLED
|
||||
// @DisplayName: CLI Enable
|
||||
// @Description: This enables/disables the checking for three carriage returns on telemetry links on startup to enter the diagnostics command line interface
|
||||
// @Values: 0:Disabled,1:Enabled
|
||||
// @User: Advanced
|
||||
GSCALAR(cli_enabled, "CLI_ENABLED", 0),
|
||||
#endif
|
||||
|
||||
// @Group: SERIAL
|
||||
// @Path: ../libraries/AP_SerialManager/AP_SerialManager.cpp
|
||||
GOBJECT(serial_manager, "SERIAL", AP_SerialManager),
|
||||
|
@ -201,13 +201,15 @@ static void init_ardupilot()
|
||||
hal.scheduler->register_timer_failsafe(failsafe_check, 1000);
|
||||
|
||||
#if CLI_ENABLED == ENABLED
|
||||
const prog_char_t *msg = PSTR("\nPress ENTER 3 times to start interactive setup\n");
|
||||
cliSerial->println_P(msg);
|
||||
if (gcs[1].initialised && (gcs[1].get_uart() != NULL)) {
|
||||
gcs[1].get_uart()->println_P(msg);
|
||||
}
|
||||
if (num_gcs > 2 && gcs[2].initialised && (gcs[2].get_uart() != NULL)) {
|
||||
gcs[2].get_uart()->println_P(msg);
|
||||
if (g.cli_enabled == 1) {
|
||||
const prog_char_t *msg = PSTR("\nPress ENTER 3 times to start interactive setup\n");
|
||||
cliSerial->println_P(msg);
|
||||
if (gcs[1].initialised && (gcs[1].get_uart() != NULL)) {
|
||||
gcs[1].get_uart()->println_P(msg);
|
||||
}
|
||||
if (num_gcs > 2 && gcs[2].initialised && (gcs[2].get_uart() != NULL)) {
|
||||
gcs[2].get_uart()->println_P(msg);
|
||||
}
|
||||
}
|
||||
#endif // CLI_ENABLED
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user