What you are doing is fine. The latency depends on the size of the buffer from channel 1 that is being copied into channel 2.
To evaluate this, calculate the time when a zero packet buffer is copied. (or just simple skip the code that does the copying and transfer empty buffer). This will give an idea on how much time is utilized in copying.
Can I get an expected latency on the MANUAL DMA Channel?
I want to know the expected time between a PRODUCE EVENT and a CONSUME EVENT. I'm currently measuring around 6ms which is too slow.
I have found that I can get the latency down to around 1ms now.
When I call: CyU3PDmaChannelGetStatus(&glChHandleSlFifoUtoP, &state, &prodXferCount, &consXferCount);
and calculate the difference: diff = prodXferCount - consXferCount;
Initially the difference is 1 but it increases over time until it reaches 40 where it stabilises. Why is this happening?
We would like the PROD EVENT and CONS EVENT to happen as close to eachother as possible (it appears that the CONS EVENT count is lagging by 40)