diff main.c @ 7:9404b9869c27

Make the LCD panel work (timings, GPIOE clock needs to be on, etc) Factor out LCD init (needs more work)
author Daniel O'Connor <darius@dons.net.au>
date Sun, 22 Jan 2012 17:10:51 +1030
parents efa2c22266e3
children 58d76cf522ff
line wrap: on
line diff
--- a/main.c	Sat Jan 14 11:42:24 2012 +1030
+++ b/main.c	Sun Jan 22 17:10:51 2012 +1030
@@ -119,14 +119,14 @@
 	    ;
     }
 
-    /* Init LCD interface */
+    /* Init LCD panel */
     LCD_init();
 
     /* Set stdout to unbuffered */
     setvbuf(stdout, NULL, _IONBF, 0);
     
     /* Say hello */
-    fputs("\r\nHello world\r\n", stdout);
+    fputs("\r\n\r\n\r\nHello world\r\n", stdout);
     
     while (1) {
 	fputs("> ", stdout);
@@ -145,8 +145,6 @@
 		tv.tv_sec = atoi(cmd.buf + 3);
 		tv.tv_usec = 0;
 		settimeofday(&tv, NULL);
-	    } else if (!strncmp("lcd", cmd.buf, 3)) {
-		printf("LCD ID = %hx\r\n", LCD_RD_Reg(0x00));
 	    } else if (!strncmp("read", cmd.buf, 4)) {
 		printf("PB5 = %d\r\n", GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_15));
 	    } else if (!strncmp("touch", cmd.buf, 5)) {
@@ -199,6 +197,10 @@
 		printf("(0x%02x)\r\n", status);
 	    } else if (!strncmp("pwm ", cmd.buf, 4)) {
 		lcd_setpwm(atoi(cmd.buf + 4));
+	    } else if (!strncmp("timing", cmd.buf, 6)) {
+		fputs("Timing..\r\n", stdout);
+		Delay(10000);
+		fputs("Done\r\n", stdout);
 	    } else if (!strncmp("zz", cmd.buf, 2)) {
 		NVIC_SystemReset();
 	    } else {