DMA frame buffer copy


    • DMA frame buffer copy


      LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void (*)())_CopyBuffer);

      The problem I'm having with DMA implementation is how to notify emWin that the buffer copy is completed. Since emWin is not expecting _CopyBuffer() to return anything, I end up with one of the following scenarios:
      1. DMA transfer is started inside _CopyBuffer() and the function returns. emWin thinks upon return that the frame buffer copy is done, so I end up with the incorrect buffer being displayed (flipping between buffers which are obviously wrong). I am using triple buffering.
      2. I create a loop inside _CopyBuffer() which waits for the DMA transfer to complete. This is no benefit over a standard memcpy().

      Am I missing something simple or is this just not possible?

      emWin V5.38
      NXP LPC546xx