blabla
Diff: vga640x400.c
- Revision:
- 1:30d7a3e8e7a3
- Parent:
- 0:78fa88bb24cb
- Child:
- 2:70daa29e01bd
diff -r 78fa88bb24cb -r 30d7a3e8e7a3 vga640x400.c --- 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();