DMA and Busy Waiting


Is it possible to not busy wait in the library while a spi transfer (via DMA) is happening?

What MCU/Processor/Board and compiler are you using?

What do you want to achieve?

What have you tried so far?

Code to reproduce

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

If you are using a display driver with double buffering, the next frame is being rendered while the current frame is being DMAed.

Thanks for the response.

I was meaning more like using the spare cpu time to run other tasks (not related to littlevgl) and on DMA completion I can schedule the lv_task_handler to run again.

Actually it makes sense to yield in lvgl until the display driver calls lv_disp_flush_ready() (to tell lvgl DMA has completed).
Today it’s just spinning:

/*In double buffered mode wait until the other buffer is flushed before flushing the current
     * one*/
    if(lv_disp_is_double_buf(disp_refr)) {

    vdb->flushing = 1;

@kisvegabor, @embeddedt - I remember vaguely that this was discussed before.
Any reason why not to call YIELD in that while loop, and let the user define YIELD in lv_conf.h?

I also recall having that discussion. I’m suspicious that we agreed on it but never got around to adding the appropriate define.

I agree with Himel_Patel.

it would be very interesting to release the cpu to perform other tasks instead of waiting.