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