From 89c85f9c5a957db02c5e618154320ca98fba4790 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 20 Mar 2013 12:35:56 +1100 Subject: [PATCH] Rover: added shell command in CLI test menu --- APMrover2/test.pde | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/APMrover2/test.pde b/APMrover2/test.pde index 523565bb3a..4a313edb2b 100644 --- a/APMrover2/test.pde +++ b/APMrover2/test.pde @@ -20,6 +20,9 @@ static int8_t test_sonar(uint8_t argc, const Menu::arg *argv); static int8_t test_mag(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. @@ -53,7 +56,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 }; // A Macro to create the Menu @@ -565,4 +570,16 @@ test_sonar(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 + #endif // CLI_ENABLED