Fixed several bugs, imported math library.
[sphoot.git] / src / ecore / render.c
1 #include "ecore.h"
2
3 #include "render.h"
4
5 uint32_t render_start, render_end;
6 uint8_t __attribute__((section(".data_bank2"))) in_buffer[0x2000];
7 uint32_t __attribute__((section(".data_bank3"))) out_buffer[NUM_OUT_ELEMENTS];
8 uint32_t *out_buffer_ptr = out_buffer;
9 void *in_buffer_ptr = in_buffer;
10
11 void render_finished() {
12     // use DMA channel 1 to transfer results back
13     e_dma_desc_t desc;
14     e_dma_set_desc(E_DMA_1, E_DMA_ENABLE | E_DMA_WORD | E_DMA_MASTER, NULL,
15         4, 4, NUM_OUT_ELEMENTS, 1, 0, 0, out_buffer,
16         (uint8_t *)shared_mem.ephy_base + shm_region->fb_off + render_start*4,
17         &desc);
18     e_dma_start(&desc, E_DMA_1);
19     e_dma_wait(E_DMA_1);
20 }