source: soft/tp16/correction/main_sequencial.c @ 48

Last change on this file since 48 was 43, checked in by alain, 14 years ago

Two modifs in isr.s and drivers.c to support one multi_timer
per processor in clusterized multi-processors architectures.
(same segment increment as the multi_tty)

File size: 1.1 KB
Line 
1#include "stdio.h"
2
3#define NBLOCS 32
4#define THRESHOLD 200
5
6int main()
7{
8char            buf_in[128*128];
9char            buf_out[128*128];
10int             i;
11int             base = 0;
12
13while(base < 5*NBLOCS)
14{
15
16        tty_printf("\n *** image %d *** at date = %d \n", base/NBLOCS, proctime());
17
18/* Phase 1 : lecture image sur le disque et transfert vers buf_in */
19        if( ioc_read(base, buf_in, NBLOCS) )
20        {
21                tty_printf("echec io_read\n");
22                exit();
23        }
24        else
25        {
26                ioc_completed();
27                tty_printf("io_read  completed at date = %d \n",proctime());
28        }
29
30/* Phase 2 : transfert de buf_in vers buf_out avec seuillage */
31        for(i=0 ; i<128*128 ; i++) 
32        {
33                if( buf_in[i] > THRESHOLD )     buf_out[i] = 255;
34                else                            buf_out[i] = buf_in[i];
35        }
36        tty_printf("image processing completed at date = %d \n",proctime());
37
38/* Phase 3 : transfert de buf_out vers le frame buffer par dma */
39        if( fb_sync_write(0,buf_out,128*128) )
40        {
41                tty_printf("echec fb_write\n");
42                exit();
43        }
44        else
45        {
46                tty_printf("transfer completed at date = %d \n",proctime());
47        }
48
49        base = base + NBLOCS;
50} // end while
51
52exit();
53
54return 0;
55
56} // end main
Note: See TracBrowser for help on using the repository browser.