The “i2s_lcd.c” driver, provided by espressif, is a little complicated, so i am trying to understand to modify it.
I dont want to use dynamic memory allocation, so i converted to static allocation.
At first it’s working, i think only the function “void i2s_lcd_write_cmd (uint8_t cmd)” stopped working, i dont know why.
I also want to change the functionality of this driver a bit if i am not lost a lot.
From what i measured, the function “int i2s_lcd_write_data( void* src, size_t size, TickType_t ticks_to_wait, bool swap)”, only return after sending all data.
This way the use of dma doesn’t make much sense.
So…
what i want to do:
I created two equal sized buffer(1/10 lcd size each buffer).
I want to send the two data buffers using dma.
Littlevgl write the first buffer and send using dma.
While dma are send the first buffer the littlevgl library write the second buffer.
And so on…
Question:
How can switch the two buffers ?
i need to somehow test that the buffer1 has just been sent and the littlevgl library finished wrote in the buffer2.
“drv->buffer->buf_act” are the buffer that littlevgl is writing or the buffer that was passed to the function “void ili9341_display_flush ( lv_disp_drv_t * drv, const lv_area_t * area )” ?
I think that if you share with us what you did and what you tried, what works for you and what doesn’t, you’d get more responses.
For example, did you try working with the double buffer mode as describe in the docs?
You say “it’s been a while since I looked”. Did you look again?? What did you try? What was the result?
Did you examine lvgl source code? Did you search where buf_act is updated? Did you have difficulties figuring out how it works? What were your difficulties?
In my opinion, just “shooting out” questions like this is less effective and has lower chances to get someone to look into it and respond.
On the other hand, if you show everyone that you made an effort to try things, research, read the docs the examples and the library source code, and still you have a problem there - you’ll have a higher chances someone would respond.
Some good tips on how to ask a good question, which applies to any forum not only on SO: https://stackoverflow.com/help/how-to-ask (See the “Search and research” in bold?)
“drv->buffer->buf_act” are the buffer that littlevgl is writing or the buffer that was passed to the function(it was already written) "void ili9341_display_flush ( lv_disp_drv_t * drv, const lv_area_t * area )” ?
Then i find a way to synchronize the buffers using freertos or only flags. Because i want to send one buffer using dma while the other buffer the cpu is updating.
Also, “buf_act” show a note that is for internal library use.