xyControl
0.1
Quadrotor Flight Controller on AVR Basis
|
Enables user interaction with an UART Menu. More...
Files | |
file | uartMenu.h |
UART Menu API Header. | |
file | uartMenu.c |
UART Menu API Implementation. | |
Data Structures | |
struct | MenuEntry |
Data Structure for Single-Linked-List for UART Menu. More... | |
Functions | |
uint8_t | addMenuCommand (uint8_t cmd, PGM_P help, Task f) |
Add a command to the UART Menu. More... | |
void | uartMenuPrintHelp (void) |
Print all registered commands. More... | |
void | uartMenuRegisterHandler (void(*handler)(char)) |
Register a Handler for unhandled menu commands. More... | |
void | uartMenuTask (void) |
Task to work the UART Menu. More... | |
MenuEntry * | findEntry (uint8_t cmd) |
Search the uartMenu Linked List. More... | |
MenuEntry * | reverseList (MenuEntry *root) |
Reverse the UART Menu List. More... | |
Variables | |
MenuEntry * | uartMenu = NULL |
Single-Linked-List for commands. More... | |
void(* | unHandler )(char) = NULL |
Handler for unhandled commands. More... | |
Enables user interaction with an UART Menu.
uint8_t addMenuCommand | ( | uint8_t | cmd, |
PGM_P | help, | ||
Task | f | ||
) |
Add a command to the UART Menu.
cmd | Byte that triggers command |
help | Help Text String in Flash |
f | Task to be executed |
Definition at line 69 of file uartMenu.c.
References BANK_GENERIC, MenuEntry::cmd, MenuEntry::f, findEntry(), MenuEntry::helpText, MenuEntry::next, uartMenu, xmemGetBank(), and xmemSetBank().
Referenced by xyInit().
MenuEntry* findEntry | ( | uint8_t | cmd | ) |
Search the uartMenu Linked List.
cmd | Command to search for |
Definition at line 58 of file uartMenu.c.
References MenuEntry::cmd, MenuEntry::next, and uartMenu.
Referenced by addMenuCommand().
Reverse the UART Menu List.
root | Root of the Single-Linked-List. |
Definition at line 93 of file uartMenu.c.
References MenuEntry::next.
Referenced by uartMenuPrintHelp().
void uartMenuPrintHelp | ( | void | ) |
Print all registered commands.
Definition at line 104 of file uartMenu.c.
References BANK_GENERIC, MenuEntry::cmd, MenuEntry::helpText, MenuEntry::next, reverseList(), uartMenu, xmemGetBank(), and xmemSetBank().
Referenced by xyInit().
void uartMenuRegisterHandler | ( | void(*)(char) | handler | ) |
Register a Handler for unhandled menu commands.
handler | Will be called if an unknown command is received. |
Definition at line 127 of file uartMenu.c.
References unHandler.
void uartMenuTask | ( | void | ) |
Task to work the UART Menu.
Definition at line 131 of file uartMenu.c.
References BANK_GENERIC, MenuEntry::cmd, MenuEntry::f, MenuEntry::next, serialAvailable(), serialGet(), serialHasChar(), uartMenu, unHandler, xmemGetBank(), and xmemSetBank().
Referenced by xyInit().
MenuEntry* uartMenu = NULL |
Single-Linked-List for commands.
Definition at line 51 of file uartMenu.c.
Referenced by addMenuCommand(), findEntry(), uartMenuPrintHelp(), and uartMenuTask().
void(* unHandler)(char) = NULL |
Handler for unhandled commands.
Definition at line 52 of file uartMenu.c.
Referenced by uartMenuRegisterHandler(), and uartMenuTask().