1.1 --- a/examples/vga-timer/main.c Wed Oct 24 13:21:21 2018 +0200
1.2 +++ b/examples/vga-timer/main.c Wed Oct 24 15:31:56 2018 +0200
1.3 @@ -140,37 +140,15 @@
1.4 ZERO_LENGTH);
1.5 dma_set_receive_events(3, 1);
1.6
1.7 - /* Configure a timer for the horizontal sync. The timer has no prescaling
1.8 - (0). */
1.9 -
1.10 - timer_init(2, 0, HFREQ_LIMIT);
1.11 - timer_on(2);
1.12 -
1.13 /* Configure a timer for line data transfers. */
1.14
1.15 timer_init(3, 0, 1);
1.16 timer_on(3);
1.17
1.18 - /* Horizontal sync. */
1.19 -
1.20 - /* Configure output compare in dual compare (continuous output) mode using
1.21 - Timer2 as time base. The interrupt condition drives the first DMA channel
1.22 - and is handled to drive the display state machine. */
1.23 + /* Configure a timer and output compare units for horizontal and vertical
1.24 + sync. */
1.25
1.26 - oc_init(1, 0b101, 2);
1.27 - oc_set_pulse(1, HSYNC_END);
1.28 - oc_set_pulse_end(1, HSYNC_START);
1.29 - oc_init_interrupt(1, 7, 3);
1.30 - oc_on(1);
1.31 -
1.32 - /* Vertical sync. */
1.33 -
1.34 - /* Configure output compare in single compare (output driven low) mode using
1.35 - Timer2 as time base. The unit is enabled later. It is only really used to
1.36 - achieve precisely-timed level transitions in hardware. */
1.37 -
1.38 - oc_init(2, 0b010, 2);
1.39 - oc_set_pulse(2, 0);
1.40 + vga_configure_sync(1, 2, 2);
1.41
1.42 uart_init(1, FPB, 115200);
1.43 uart_on(1);