Three-pin 640x400 VGA Console Mode

Dependents:   projet_AWA_testVGA2

Files at this revision

API Documentation at this revision

Comitter:
Ivop
Date:
Fri Jul 08 17:22:08 2011 +0000
Parent:
0:78fa88bb24cb
Child:
2:70daa29e01bd
Commit message:
Removed init of uart0 for debug messages out of \release\ build. This has nothing to do with VGA so it shouldn\t be in the library.

Changed in this revision

vga640x400.c Show annotated file Show diff for this revision Revisions of this file
--- a/vga640x400.c	Sun Jul 03 18:13:20 2011 +0000
+++ b/vga640x400.c	Fri Jul 08 17:22:08 2011 +0000
@@ -24,7 +24,9 @@
 
 #include <string.h>
 
-#if 0       // DEBUG messages on UART0
+#define DEBUG_VGA 0
+
+#if DEBUG_VGA       // DEBUG messages on UART0
 #include <stdio.h>
 #define dbprintf(...) printf(__VA_ARGS__)
 #else
@@ -81,12 +83,14 @@
 
 // -----------------------------------------------------------------------------------
 
+#if DEBUG_VGA
 static void init_uart0(unsigned divaddval, unsigned mulval, unsigned divisor) {
     fl_power_uart0(FL_ON);
     fl_select_clock_uart0(FL_CLOCK_DIV1);
     fl_uart_set_fractional_divider(0, divaddval, mulval);
     fl_uart_set_divisor_latch(0, divisor);
 }
+#endif
 
 // -----------------------------------------------------------------------------------
 
@@ -251,8 +255,11 @@
     fl_power_off_all_peripherals();
 
     init_pll0(FL_PLL0_CLOCK_SOURCE_MAIN, 2, 25, 3); // 100MHz
+
+#if DEBUG_VGA
     init_uart0(0, 0, 651);                          // 100MHz/651/16=9600.6 (default 8N1)
-    
+#endif
+
     init_vsync(0, 6);                               // VSYNC on P0.6 (DIP8)
     init_i2s();
     init_hsync();