comparison lcdtest/dispatch.c @ 16:1e94c7d4af03

lcdtest: raw FTDI command fc added
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 07 Apr 2018 17:52:53 +0000
parents 5a602e512b12
children 43cc53581975
comparison
equal deleted inserted replaced
15:4194b6744890 16:1e94c7d4af03
2 #include <stdio.h> 2 #include <stdio.h>
3 #include <string.h> 3 #include <string.h>
4 #include <strings.h> 4 #include <strings.h>
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 extern int cmd_fc();
7 extern int cmd_fr(); 8 extern int cmd_fr();
8 extern int cmd_rd(); 9 extern int cmd_rd();
9 extern int cmd_ri(); 10 extern int cmd_ri();
10 extern int cmd_wd(); 11 extern int cmd_wd();
11 extern int cmd_wi(); 12 extern int cmd_wi();
23 int minargs; 24 int minargs;
24 int maxargs; 25 int maxargs;
25 int (*func)(); 26 int (*func)();
26 } cmdtab[] = { 27 } cmdtab[] = {
27 {"exit", 0, 0, cmd_exit}, 28 {"exit", 0, 0, cmd_exit},
29 {"fc", 1, 16, cmd_fc},
28 {"fr", 1, 1, cmd_fr}, 30 {"fr", 1, 1, cmd_fr},
29 {"quit", 0, 0, cmd_exit}, 31 {"quit", 0, 0, cmd_exit},
30 {"rd", 0, 0, cmd_rd}, 32 {"rd", 0, 0, cmd_rd},
31 {"reset", 0, 0, reset_pulse}, 33 {"reset", 0, 0, reset_pulse},
32 {"ri", 0, 0, cmd_ri}, 34 {"ri", 0, 0, cmd_ri},
37 }; 39 };
38 40
39 dispatch_cmd(cmd) 41 dispatch_cmd(cmd)
40 char *cmd; 42 char *cmd;
41 { 43 {
42 char *argv[10]; 44 char *argv[18];
43 char *cp, **ap; 45 char *cp, **ap;
44 struct cmdtab *tp; 46 struct cmdtab *tp;
45 47
46 for (cp = cmd; isspace(*cp); cp++) 48 for (cp = cmd; isspace(*cp); cp++)
47 ; 49 ;