Changeset 218 for soft/giet_vm/display
- Timestamp:
- Sep 19, 2012, 10:52:43 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/display/main.c
r207 r218 2 2 3 3 #define NBLOCS 32 4 #define THRESHOLD 2005 4 6 5 __attribute__((constructor)) int main(void) 7 6 { 8 unsigned char buf_in[128*128]; 9 unsigned char buf_out[128*128]; 7 unsigned char buf[128*128]; 8 unsigned int x; 9 unsigned int base = 0; 10 10 11 unsigned int i; 12 unsigned int x; 13 unsigned int base = 0; 14 15 while (base < 5 * NBLOCS) 11 while (base < 10 * NBLOCS) 16 12 { 17 13 giet_tty_printf("\n *** image %d *** at date = %d \n", 18 14 base / NBLOCS, giet_proctime()); 19 15 20 /* Phase 1 : lecture image sur le disque et transfert vers buf _in*/21 x = giet_ioc_read(base, buf _in, NBLOCS);16 /* Phase 1 : lecture image sur le disque et transfert vers buf */ 17 x = giet_ioc_read(base, buf, NBLOCS); 22 18 if ( x ) 23 19 { … … 31 27 giet_exit(); 32 28 } 33 giet_tty_printf("io _read completed at date = %d \n", giet_proctime());29 giet_tty_printf("ioc_read completed at date = %d \n", giet_proctime()); 34 30 35 /* Phase 2 : transfert de buf_in vers buf_out avec seuillage */ 36 for (i = 0; i < 128 * 128; i++) 37 { 38 if (buf_in[i] > THRESHOLD) 39 buf_out[i] = 255; 40 else 41 buf_out[i] = buf_in[i]; 42 } 43 giet_tty_printf("image processing completed at date = %d \n", giet_proctime()); 44 45 /* Phase 3 : transfert de buf_out vers le frame buffer par dma */ 46 x = giet_fb_write(0, buf_out, 128 * 128); 31 // Phase 2 : transfert de buf vers le frame buffer par dma 32 x = giet_fb_write(0, buf, 128 * 128); 47 33 if ( x ) 48 34 { … … 50 36 giet_exit(); 51 37 } 38 39 giet_tty_printf("fb_write ok at date : %d\n", giet_proctime() ); 52 40 53 41 x = giet_fb_completed(); … … 57 45 giet_exit(); 58 46 } 59 giet_tty_printf(" transfercompleted at date = %d \n", giet_proctime());47 giet_tty_printf("display completed at date = %d \n", giet_proctime()); 60 48 61 49 base = base + NBLOCS;
Note: See TracChangeset
for help on using the changeset viewer.