source: soft/giet_vm/display/main.c @ 249

Last change on this file since 249 was 249, checked in by alain, 11 years ago

Various modifications to support IO Bridge,
and MEMC configuration interface.

File size: 1.6 KB
RevLine 
[191]1#include <stdio.h>
2
[249]3#define NBLOCS 32   // (128 * 128) / 512
[191]4
[249]5unsigned char buf[128*128] __attribute__((aligned(64)));
6
[191]7__attribute__((constructor)) int main(void)
8{
[218]9    unsigned int  x;
10    unsigned int  base = 0;
[207]11
[218]12    while (base < 10 * NBLOCS)
[191]13    {
14        giet_tty_printf("\n *** image %d *** at date = %d \n",
15                base / NBLOCS, giet_proctime());
16
[218]17        /* Phase 1 : lecture image sur le disque et transfert vers buf */
18        x = giet_ioc_read(base, buf, NBLOCS);
[191]19        if ( x )
20        {
[238]21            giet_tty_printf("echec giet_ioc_read = %d at date : %d\n", x , giet_proctime() );
[191]22            giet_exit();
23        }
24        x = giet_ioc_completed();
25        if ( x )
26        {
[238]27            giet_tty_printf("echec giet_ioc_completed = %d at date : %d\n", x, giet_proctime() );
[191]28            giet_exit();
29        }
[218]30        giet_tty_printf("ioc_read  completed at date = %d \n", giet_proctime());
[191]31
[218]32        // Phase 2 : transfert de buf vers le frame buffer par dma
[249]33        x = giet_fb_sync_write(0, buf, 128 * 128);
[191]34        if ( x )
35        {
[238]36            giet_tty_printf("echec giet_fb_write = %d at date : %d\n", x, giet_proctime() );
[191]37            giet_exit();
38        }
[207]39
[249]40/*
[218]41        giet_tty_printf("fb_write ok at date : %d\n", giet_proctime() );
42
[191]43        x = giet_fb_completed();
44        if ( x )
45        {
[238]46            giet_tty_printf("echec giet_fb_completed = %d at date : %d\n", x, giet_proctime() );
[191]47            giet_exit();
48        }
[249]49*/
[218]50        giet_tty_printf("display completed at date = %d \n", giet_proctime());
[191]51
52        base = base + NBLOCS;
53    }
54
55    giet_exit();
56
57    return 0;
58}
Note: See TracBrowser for help on using the repository browser.