[191] | 1 | #include <stdio.h> |
---|
| 2 | |
---|
[249] | 3 | #define NBLOCS 32 // (128 * 128) / 512 |
---|
[191] | 4 | |
---|
[249] | 5 | unsigned 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 | } |
---|