changeset 16:1e94c7d4af03

lcdtest: raw FTDI command fc added
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 07 Apr 2018 17:52:53 +0000
parents 4194b6744890
children 43cc53581975
files lcdtest/commands.c lcdtest/dispatch.c
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lcdtest/commands.c	Sat Apr 07 06:24:16 2018 +0000
+++ b/lcdtest/commands.c	Sat Apr 07 17:52:53 2018 +0000
@@ -1,6 +1,19 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+cmd_fc(argc, argv)
+	char **argv;
+{
+	u_char cmdbuf[16];
+	unsigned di = 0;
+	char **ap;
+
+	for (ap = argv + 1; *ap; ap++)
+		cmdbuf[di++] = strtoul(*ap, 0, 16);
+	do_ftdi_write(cmdbuf, di);
+	return(0);
+}
+
 cmd_wi(argc, argv)
 	char **argv;
 {
--- a/lcdtest/dispatch.c	Sat Apr 07 06:24:16 2018 +0000
+++ b/lcdtest/dispatch.c	Sat Apr 07 17:52:53 2018 +0000
@@ -4,6 +4,7 @@
 #include <strings.h>
 #include <stdlib.h>
 
+extern int cmd_fc();
 extern int cmd_fr();
 extern int cmd_rd();
 extern int cmd_ri();
@@ -25,6 +26,7 @@
 	int (*func)();
 } cmdtab[] = {
 	{"exit", 0, 0, cmd_exit},
+	{"fc", 1, 16, cmd_fc},
 	{"fr", 1, 1, cmd_fr},
 	{"quit", 0, 0, cmd_exit},
 	{"rd", 0, 0, cmd_rd},
@@ -39,7 +41,7 @@
 dispatch_cmd(cmd)
 	char *cmd;
 {
-	char *argv[10];
+	char *argv[18];
 	char *cp, **ap;
 	struct cmdtab *tp;