diff --git a/libraries/AP_Menu/AP_Menu.cpp b/libraries/AP_Menu/AP_Menu.cpp index 99b2039854..55558b4305 100644 --- a/libraries/AP_Menu/AP_Menu.cpp +++ b/libraries/AP_Menu/AP_Menu.cpp @@ -2,17 +2,14 @@ // // Simple commandline menu system. -// +#include "AP_Menu.h" -#include -#include -#include - -#include #include +#include #include -#include "AP_Menu.h" +#include +#include extern const AP_HAL::HAL& hal; @@ -239,10 +236,7 @@ Menu::_help(void) int8_t Menu::_call(uint8_t n, uint8_t argc) { - func fn; - - pgm_read_block(&_commands[n].func, &fn, sizeof(fn)); - return(fn(argc, &_argv[0])); + return _commands[n].func(argc, &_argv[0]); } /**