Morning all,
Not fully awake yet, nor had coffee,
We need to go through and maybe remove several of those buffers. Especially the uint16_t one that may not be used anymore as we don't convert from 8 bits to 16 bits...
Also should look at the sendImage stuff to see again to see if we can combine some of these. The dma code alternates between two buffers. It returns you one, as it start working on the other... It currently uses frameBuffer and frameBuffer2, but it could just as easily use sendImageBuf and half way through that buffer.
As for what do I use to do the actual DMA? I cheat. Inside the class I have:
Code:
enum {DMABUFFER_SIZE=1296}; // 640x480 so 640*2*2
static DMAChannel _dmachannel;
static DMASetting _dmasettings[2];
static uint32_t _dmaBuffer1[DMABUFFER_SIZE];
static uint32_t _dmaBuffer2[DMABUFFER_SIZE];
In the cpp file I have:
Code:
DMAChannel HM01B0::_dmachannel;
DMASetting HM01B0::_dmasettings[2];
uint32_t HM01B0::_dmaBuffer1[DMABUFFER_SIZE] __attribute__ ((used, aligned(32)));
uint32_t HM01B0::_dmaBuffer2[DMABUFFER_SIZE] __attribute__ ((used, aligned(32)));