From c41b927a15585fc94668152804f6db010ca10633 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 7 Feb 2013 15:04:22 +1100 Subject: [PATCH] Plane: added shell command for px4 used to launch nsh for PX4IO firmware upgrades --- ArduPlane/test.pde | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ArduPlane/test.pde b/ArduPlane/test.pde index f02e74e725..ecfc776283 100644 --- a/ArduPlane/test.pde +++ b/ArduPlane/test.pde @@ -24,6 +24,9 @@ static int8_t test_eedump(uint8_t argc, const Menu::arg *argv); static int8_t test_rawgps(uint8_t argc, const Menu::arg *argv); static int8_t test_modeswitch(uint8_t argc, const Menu::arg *argv); static int8_t test_logging(uint8_t argc, const Menu::arg *argv); +#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 +static int8_t test_shell(uint8_t argc, const Menu::arg *argv); +#endif // Creates a constant array of structs representing menu options // and stores them in Flash memory, not RAM. @@ -60,6 +63,9 @@ static const struct Menu::command test_menu_commands[] PROGMEM = { #elif HIL_MODE == HIL_MODE_ATTITUDE #endif {"logging", test_logging}, +#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 + {"shell", test_shell}, +#endif }; @@ -406,6 +412,18 @@ test_logging(uint8_t argc, const Menu::arg *argv) return 0; } +#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 +/* + * run a debug shell + */ +static int8_t +test_shell(uint8_t argc, const Menu::arg *argv) +{ + hal.util->run_debug_shell(cliSerial); + return 0; +} +#endif + //------------------------------------------------------------------------------------------- // tests in this section are for real sensors or sensors that have been simulated