mirror of https://github.com/ArduPilot/ardupilot
Plane: fix startup of CLI menu system
This commit is contained in:
parent
fe93bdbc5e
commit
97145f20fc
|
@ -63,6 +63,7 @@ void GCS_Plane::setup_uarts(AP_SerialManager &serial_manager)
|
|||
}
|
||||
}
|
||||
|
||||
#if CLI_ENABLED == ENABLED
|
||||
void GCS_Plane::handle_interactive_setup()
|
||||
{
|
||||
if (plane.g.cli_enabled == 1) {
|
||||
|
@ -76,3 +77,4 @@ void GCS_Plane::handle_interactive_setup()
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <GCS_MAVLink/GCS.h>
|
||||
#include "GCS_Mavlink.h"
|
||||
#include "config.h" // for CLI_ENABLED
|
||||
|
||||
class GCS_Plane : public GCS
|
||||
{
|
||||
|
@ -26,7 +27,9 @@ public:
|
|||
|
||||
void set_run_cli_func(run_cli_fn run_cli) { _run_cli = run_cli; }
|
||||
void setup_uarts(AP_SerialManager &serial_manager);
|
||||
#if CLI_ENABLED == ENABLED
|
||||
void handle_interactive_setup();
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -27,10 +27,6 @@ Plane::Plane(void)
|
|||
auto_state.takeoff_complete = true;
|
||||
auto_state.next_wp_no_crosstrack = true;
|
||||
auto_state.no_crosstrack = true;
|
||||
|
||||
if (plane.g.cli_enabled) {
|
||||
gcs().set_run_cli_func(FUNCTOR_BIND_MEMBER(&Plane::run_cli, void, AP_HAL::UARTDriver *));
|
||||
}
|
||||
}
|
||||
|
||||
Plane plane;
|
||||
|
|
|
@ -124,6 +124,14 @@ void Plane::init_ardupilot()
|
|||
serial_manager.init();
|
||||
gcs().chan(0).setup_uart(serial_manager, AP_SerialManager::SerialProtocol_MAVLink, 0);
|
||||
|
||||
|
||||
// specify callback function for CLI menu system
|
||||
#if CLI_ENABLED == ENABLED
|
||||
if (g.cli_enabled) {
|
||||
gcs().set_run_cli_func(FUNCTOR_BIND_MEMBER(&Plane::run_cli, void, AP_HAL::UARTDriver *));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Register mavlink_delay_cb, which will run anytime you have
|
||||
// more than 5ms remaining in your call to hal.scheduler->delay
|
||||
hal.scheduler->register_delay_callback(mavlink_delay_cb_static, 5);
|
||||
|
|
Loading…
Reference in New Issue