Rover: added CLI_ENABLED parameter

This commit is contained in:
Andrew Tridgell 2015-03-09 14:20:37 +11:00
parent 3f906f6bd1
commit b8ab87ea86
3 changed files with 14 additions and 8 deletions

View File

@ -1238,7 +1238,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

View File

@ -70,6 +70,7 @@ public:
k_param_serial2_baud_old,
k_param_serial2_protocol, // deprecated, can be deleted
k_param_serial_manager, // serial manager library
k_param_cli_enabled,
//
// 130: Sensor parameters
@ -213,6 +214,9 @@ public:
AP_Int16 sysid_my_gcs;
AP_Int8 telem_delay;
AP_Int8 skip_gyro_cal;
#if CLI_ENABLED == ENABLED
AP_Int8 cli_enabled;
#endif
// sensor parameters
AP_Int8 compass_enabled;

View File

@ -192,13 +192,15 @@ static void init_ardupilot()
// the system in an odd state, we don't let the user exit the top
// menu; they must reset in order to fly.
//
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