changeset 953:9e1be763b626

c139explore: hbars and vbars tests implemented
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Wed, 04 Nov 2015 04:09:44 +0000
parents 15b1b396ad23
children d25d73815817
files target-utils/c139explore/cmdtab.c target-utils/c139explore/lcd.c
diffstat 2 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/target-utils/c139explore/cmdtab.c	Wed Nov 04 03:51:00 2015 +0000
+++ b/target-utils/c139explore/cmdtab.c	Wed Nov 04 04:09:44 2015 +0000
@@ -3,6 +3,7 @@
 extern void cmd_abbr();
 extern void cmd_abbw();
 extern void cmd_dbl();
+extern void cmd_hbars();
 extern void cmd_kpbl();
 extern void cmd_lcdcmd();
 extern void cmd_lcdfill();
@@ -11,6 +12,7 @@
 extern void cmd_r8();
 extern void cmd_r16();
 extern void cmd_r32();
+extern void cmd_vbars();
 extern void cmd_w8();
 extern void cmd_w16();
 extern void cmd_w32();
@@ -23,6 +25,7 @@
 	{"abbr", cmd_abbr},
 	{"abbw", cmd_abbw},
 	{"dbl", cmd_dbl},
+	{"hbars", cmd_hbars},
 	{"kpbl", cmd_kpbl},
 	{"lcdcmd", cmd_lcdcmd},
 	{"lcdfill", cmd_lcdfill},
@@ -32,6 +35,7 @@
 	{"r8", cmd_r8},
 	{"r16", cmd_r16},
 	{"r32", cmd_r32},
+	{"vbars", cmd_vbars},
 	{"w8", cmd_w8},
 	{"w16", cmd_w16},
 	{"w32", cmd_w32},
--- a/target-utils/c139explore/lcd.c	Wed Nov 04 03:51:00 2015 +0000
+++ b/target-utils/c139explore/lcd.c	Wed Nov 04 04:09:44 2015 +0000
@@ -122,3 +122,53 @@
 	while (npix--)
 		send_pixel_value(pixval);
 }
+
+void
+cmd_hbars()
+{
+	int i, j, k, p;
+
+	/*
+	 * The result of this command should be 8 horizontal bars
+	 * in the natural RGB order.
+	 */
+	set_lcd_addr_region(16, 79, 0, 63);
+	for (i = 0; i < 8; i++) {
+		for (j = 0; j < 8; j++) {
+			p = 0;
+			if (i & 4)
+				p |= 0xF800;
+			if (i & 2)
+				p |= 0x07E0;
+			if (i & 1)
+				p |= 0x001F;
+			for (k = 0; k < 64; k++)
+				send_pixel_value(p);
+		}
+	}
+}
+
+void
+cmd_vbars()
+{
+	int i, j, k, p;
+
+	/*
+	 * The result of this command should be 8 vertical bars
+	 * in the natural RGB order.
+	 */
+	set_lcd_addr_region(16, 79, 0, 63);
+	for (i = 0; i < 64; i++) {
+		for (j = 0; j < 8; j++) {
+			p = 0;
+			if (j & 4)
+				p |= 0xF800;
+			if (j & 2)
+				p |= 0x07E0;
+			if (j & 1)
+				p |= 0x001F;
+			for (k = 0; k < 8; k++)
+				send_pixel_value(p);
+		}
+	}
+}