forked from haumduino/24h
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
27 lines (21 loc) · 702 Bytes
/
shell.h
File metadata and controls
27 lines (21 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef __SHELL_H__
#define __SHELL_H__
#include <avr/pgmspace.h>
#include <stdbool.h>
typedef struct {
const char *text;
const char *description;
void (*function)(const char *);
bool debug;
} shell_command_t;
#define SHELL_COMMAND_DECL(ID, TEXT, DESCRIPTION, DEBUG, FUNCTION) \
static const char menu##ID##_text[] PROGMEM = TEXT; \
static const char menu##ID##_description[] PROGMEM = DESCRIPTION; \
shell_commands[ID].text = menu##ID##_text; \
shell_commands[ID].description = menu##ID##_description; \
shell_commands[ID].debug = DEBUG; \
shell_commands[ID].function = FUNCTION;
void shell_setup(void);
void shell_loop(void);
void shell_command_help(const char*);
#endif // __SHELL_H__