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

Last change on this file since 228 was 218, checked in by alain, 12 years ago

Introducing support for Network controller

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