changeset 909:16ed75e266f2

rvinterf LCD output inversion option implemented
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 07 Sep 2015 17:25:30 +0000
parents ed5dcc53e0b3
children d1333db6385f
files rvinterf/lowlevel/rviflcd.c rvinterf/lowlevel/rvifmain.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/lowlevel/rviflcd.c	Mon Sep 07 10:55:01 2015 +0000
+++ b/rvinterf/lowlevel/rviflcd.c	Mon Sep 07 17:25:30 2015 +0000
@@ -14,6 +14,7 @@
 
 char *extlcd_program;
 FILE *extlcd_pout;
+u_char extlcd_invert;
 
 void
 open_extlcd_pipe()
@@ -32,7 +33,8 @@
 
 	fprintf(extlcd_pout, "%u %u ", rxpkt[1], rxpkt[2]);
 	for (i = 3; i < rxpkt_len; i += 2)
-		fprintf(extlcd_pout, "%02X%02X", rxpkt[i+1], rxpkt[i]);
+		fprintf(extlcd_pout, "%02X%02X", rxpkt[i+1] ^ extlcd_invert,
+			rxpkt[i] ^ extlcd_invert);
 	fputc('\n', extlcd_pout);
 	fflush(extlcd_pout);
 }
--- a/rvinterf/lowlevel/rvifmain.c	Mon Sep 07 10:55:01 2015 +0000
+++ b/rvinterf/lowlevel/rvifmain.c	Mon Sep 07 17:25:30 2015 +0000
@@ -18,6 +18,7 @@
 extern int target_fd, listener;
 extern char *baudrate_name;
 extern char *extlcd_program;
+extern u_char extlcd_invert;
 
 extern u_char rxpkt[];
 extern size_t rxpkt_len;
@@ -44,7 +45,7 @@
 	fd_set fds;
 	struct client *cli, **clip;
 
-	while ((c = getopt(argc, argv, "bB:d:l:ns:S:w:X:")) != EOF)
+	while ((c = getopt(argc, argv, "bB:d:l:ns:S:vw:X:")) != EOF)
 		switch (c) {
 		case 'b':
 			background++;
@@ -67,6 +68,9 @@
 		case 'S':
 			socketpair_fd = atoi(optarg);
 			continue;
+		case 'v':
+			extlcd_invert = 0xFF;
+			continue;
 		case 'w':
 			wakeup_after_sec = strtoul(optarg, 0, 0);
 			continue;