Browse Source

AP_Menu: create new library with menu from AP_Common

master
Pat Hickey 12 years ago
parent
commit
1bf21aae20
  1. 1
      libraries/AP_Common/AP_Common.h
  2. 2
      libraries/AP_Menu/AP_Menu.cpp
  3. 6
      libraries/AP_Menu/AP_Menu.h
  4. 1
      libraries/AP_Menu/examples/menu/Makefile
  5. 2
      libraries/AP_Menu/examples/menu/menu.pde

1
libraries/AP_Common/AP_Common.h

@ -34,7 +34,6 @@ typedef struct { @@ -34,7 +34,6 @@ typedef struct {
} prog_char_t;
#include <stdint.h>
#include "include/menu.h" /// simple menu subsystem
#include "c++.h" // c++ additions
//#include "AP_Vector.h"
//#include "AP_Loop.h"

2
libraries/AP_Common/menu.cpp → libraries/AP_Menu/AP_Menu.cpp

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
#include <string.h>
#include <avr/pgmspace.h>
#include "include/menu.h"
#include "AP_Menu.h"
// statics
char Menu::_inbuf[MENU_COMMANDLINE_MAX];

6
libraries/AP_Common/include/menu.h → libraries/AP_Menu/AP_Menu.h

@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
/// Arguments passed to the handler function are pre-converted to both
/// long and float for convenience.
#ifndef __AP_COMMON_MENU_H
#define __AP_COMMON_MENU_H
#ifndef __AP_MENU_H__
#define __AP_MENU_H__
#include <inttypes.h>
@ -140,4 +140,4 @@ private: @@ -140,4 +140,4 @@ private:
static const char __menu_name__ ## name[] PROGMEM = prompt; \
static Menu name(__menu_name__ ## name, commands, sizeof(commands) / sizeof(commands[0]), preprompt)
#endif
#endif // __AP_COMMON_MENU_H__

1
libraries/AP_Menu/examples/menu/Makefile

@ -0,0 +1 @@ @@ -0,0 +1 @@
include ../../../AP_Common/Arduino.mk

2
libraries/AP_Common/examples/menu/menu.pde → libraries/AP_Menu/examples/menu/menu.pde

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
#include <FastSerial.h>
#include <AP_Common.h>
#include <AP_Param.h>
#include <AP_Menu.h>
FastSerialPort0(Serial);
Loading…
Cancel
Save