Hi
NorthGuy,
I thank you again for your wise notes!
I mis-explained myself.
Right now, I'm triggering the DMA every half buffer, i.e. every 5KB.
Every time I reach the 2nd half, I trigger the DMA to transfer the 1st half.
Every time I reach the 1st half, I trigger the DMA to transfer the 2nd half.
I want to keep triggering the DMA to transfer half buffer.
But, now, I want to do one change,
(Buffer Size is 10KB)
When I reach address (Start_Of_Buffer + 7,500), I wanna transfer the 1st half (0-5KB),
When I reach address (Start_Of_Buffer + 2,500), I wanna transfer the 2nd half (5-10KB).
I thought of doing it that way:
C:
int Counter = 0; //Global Counter
int SrcAddrArr[2] = {BUFFER_START_ADDRESS, BUFFER_MID_ADDRESS}
int SrcAddrIndex = 1;
/*** On Each Logging Function ***/
Counter += Len; //Increment the Counter by Len of each Message
if (Counter >=7168) //7168 = 7KB
{
TriggerDma(SrcAddrArr[SrcAddrIndex], DestAddr); //DMA Transfers 5120Bytes from SrcAddrArr[SrcAddrIndex] to DestAddr
Counter -= 5120;
SrcAddrIndex ^= 1;
}
What do you think of it?
Thank you
NorthGuy.