|
|
|
@ -1,27 +1,28 @@
@@ -1,27 +1,28 @@
|
|
|
|
|
|
|
|
|
|
#include <FastSerial.h> |
|
|
|
|
#include <AP_Common.h> |
|
|
|
|
#include <AP_Math.h> |
|
|
|
|
#include <AP_Progmem.h> |
|
|
|
|
#include <AP_Menu.h> |
|
|
|
|
#include <AP_HAL.h> |
|
|
|
|
#include <AP_HAL_AVR.h> |
|
|
|
|
|
|
|
|
|
FastSerialPort0(Serial); |
|
|
|
|
const AP_HAL::HAL& hal = AP_HAL_AVR_APM2; |
|
|
|
|
|
|
|
|
|
int8_t |
|
|
|
|
menu_test(uint8_t argc, const Menu::arg *argv) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
Serial.printf("This is a test with %d arguments\n", argc); |
|
|
|
|
hal.console->printf("This is a test with %d arguments\n", argc); |
|
|
|
|
for (i = 1; i < argc; i++) { |
|
|
|
|
Serial.printf("%d: int %ld float ", i, argv[i].i); |
|
|
|
|
Serial.println(argv[i].f, 6); // gross |
|
|
|
|
hal.console->printf("%d: int %ld float ", i, argv[i].i); |
|
|
|
|
hal.console->println(argv[i].f, 6); // gross |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int8_t |
|
|
|
|
menu_auto(uint8_t argc, const Menu::arg *argv) |
|
|
|
|
{ |
|
|
|
|
Serial.println("auto text"); |
|
|
|
|
hal.console->println("auto text"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const struct Menu::command top_menu_commands[] PROGMEM = { |
|
|
|
@ -34,7 +35,7 @@ MENU(top, "menu", top_menu_commands);
@@ -34,7 +35,7 @@ MENU(top, "menu", top_menu_commands);
|
|
|
|
|
void |
|
|
|
|
setup(void) |
|
|
|
|
{ |
|
|
|
|
Serial.begin(38400); |
|
|
|
|
hal.console->println_P(PSTR("AP_Menu unit test")); |
|
|
|
|
top.run(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -43,3 +44,4 @@ loop(void)
@@ -43,3 +44,4 @@ loop(void)
|
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AP_HAL_MAIN(); |
|
|
|
|