-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd.h
More file actions
43 lines (32 loc) · 1.15 KB
/
cmd.h
File metadata and controls
43 lines (32 loc) · 1.15 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*==============================================================================
Header for the Command Table
=============================================================================*/
#ifndef CMD_H
#define CMD_H
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <avr/io.h>
#include "global.h"
#include "uart.h"
/* ---------------------------------- */
/* Registered commands and callbacks */
/* ---------------------------------- */
extern char * cmd_name[];
extern int (*cmd_list[])(uint8_t argc, char ** argv);
/* --------------------------------- */
/* Command arguments from terminal */
/* --------------------------------- */
# define ARGV_SIZE 24
extern char *argv[ARGV_SIZE];
extern uint8_t argc;
/* ----------------------------------- */
/* Helper functions for parsing etc. */
/* ----------------------------------- */
/* tokenize str_buffer for argument passing, str_buffer is modified */
extern uint8_t tokenize(char **tokens, char *str_buffer, const char* delim);
/* for parsing commands in cli context */
extern void cli_ParseCommand(unsigned int cmd_list_len);
/* behavior after keypress */
extern void cli_Keypress();
#endif