Ignore:
Timestamp:
Nov 21, 2015, 2:25:14 PM (9 years ago)
Author:
alain
Message:

Update graphical applications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/display/display.c

    r720 r724  
    6666    giet_fbf_alloc();
    6767
    68     // get a Chained Buffer DMA channel
    69     giet_fbf_cma_alloc();
     68    // get a Chained Buffer DMA channel for two user buffers
     69    giet_fbf_cma_alloc( 2 );
    7070
    71     // initialize the source and destination chbufs
    72     giet_fbf_cma_init_buf( buf0 , buf1 , sts0 , sts1 );
     71    // register the two user buffers
     72    giet_fbf_cma_init_buf( 0 , buf0 , sts0 );
     73    giet_fbf_cma_init_buf( 1 , buf1 , sts1 );
    7374
    74     // start Chained Buffer DMA channel
    75     giet_fbf_cma_start( NPIXELS*NLINES );
     75    // start CMA peripheral
     76    giet_fbf_cma_start();
    7677   
    7778    giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] starts CMA at cycle %d\n",
     
    8182    while ( 1 )
    8283    {
    83         // load buf0
    84         giet_fat_read( fd, buf0, NPIXELS*NLINES );
    85 
    86         giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] load image %d at cycle %d\n",
    87                         x, y, p, image, giet_proctime() );
    88 
    89         // display buf0
    90         giet_fbf_cma_display( 0 );
     84        //////   handling buf0
     85        giet_fbf_cma_check( 0 );                       // check buf0 empty
     86        giet_fat_read( fd, buf0, NPIXELS*NLINES );     // load buf0 from disk
     87        giet_fbf_cma_display( 0 );                     // display buf0
    9188
    9289        giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] display image %d at cycle %d\n",
    9390                        x, y, p, image, giet_proctime() );
    94 
    9591        image++;
    9692
     
    9894        {
    9995            image = 0;
    100             giet_fat_lseek( fd , 0 , 0 );
     96            giet_fat_lseek( fd , 0 , SEEK_SET );
    10197        }
    10298
    10399        if ( INTERACTIVE ) giet_tty_getc( &byte );
    104100
    105         // load buf1
    106         giet_fat_read( fd, buf1, NPIXELS*NLINES );
    107 
    108         giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] load image %d at cycle %d\n",
    109                         x, y, p, image, giet_proctime() );
    110 
    111         // display buf1
    112         giet_fbf_cma_display( 1 );
     101        //////   handling buf1
     102        giet_fbf_cma_check( 1 );                       // check buf1 empty
     103        giet_fat_read( fd, buf1, NPIXELS*NLINES );     // load buf1 from disk
     104        giet_fbf_cma_display( 1 );                     // display buf1
    113105
    114106        giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] display image %d at cycle %d\n",
    115107                        x, y, p, image, giet_proctime() );
    116 
    117108        image++;
    118109
     
    120111        {
    121112            image = 0;
    122             giet_fat_lseek( fd , 0 , 0 );
     113            giet_fat_lseek( fd , 0 , SEEK_SET );
    123114        }
    124115
Note: See TracChangeset for help on using the changeset viewer.