Description
Hi, I have a problem when I tried to optimice my_flush_cb function. I am using SPI by DMA, sending the buffer to display controller (RA8875). I have configured an FreeRTOS LVGL_task, where the lv_task_handler is updating each 5ms.
When I use my_flush_cb function in blocking mode, writing line by line of the buffer switching a FLAG in the wr_cplt_callback to increment the line to print, it works well. But i want to send the complete buffer setting an active windows and making lv_disp_flush_ready in the callback. When I made this, the display print until the last line and LVGL_task get block there, and never end to print the display.
I could solved this setting a taskDelay(5) in my_flush_cb function, but this make the print slow.
What MCU/Processor/Board and compiler are you using?
I am unsing an STM32F412 and Keil compiler
What LVGL version are you using?
V7.3
What do you want to achieve?
I want to accelerate my the draw map, using lv_disp_flush_ready in the wr complete callback of SPI by DMA transfer and double buffer.
I leave you an example code where you can see how it is working, and a picture where you can find the print problem
void my_flush_cb(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
width = area->x2 - area->x1;
height = area->y2 - area->y1;
uint32_t count = (width+1)*(height+1)*2;
new_buf_to_print=1;
RA8875_Active_Window(area->x1,area->x2 ,area->y1 ,area->y2);
RA8875_setXY(area->x1, area->y1);
RA8875_send((uint16_t *)color_p,count+1);
// ----------------------------
// FLAG=0;
// while(FLAG==0)
// ;
// ---------or--------------
// vTaskDelay(10);
}
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi)
{
UNUSED(hspi);
LCD_CS_GPIO_Port->BSRR = LCD_CS_Pin;
FLAG=1;
if(new_buf_to_print==1){
new_buf_to_print=0;
lv_disp_flush_ready(&disp_drv);
}
}
void vApplicationTickHook(void)
{
lv_tick_inc(1);
}
void vTaskLVGL( void *pvParameters )
{
lv_init();
lv_init_objects();
for(;;){
vTaskDelay(5);
lv_task_handler();
}
vTaskDelete(NULL);
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.
Thank you