when I use the helloworld demo, and enable VDB malloc in psram, don’t know what happened. no clues.
/*===================
Graphical settings
*===================*/
/* Horizontal and vertical resolution of the library.*/
#define LV_HOR_RES (320)
#define LV_VER_RES (240)
#define LV_DPI 100
/* Size of VDB (Virtual Display Buffer: the internal graphics buffer).
* Required for buffered drawing, opacity and anti-aliasing
* VDB makes the double buffering, you don't need to deal with it!
* Typical size: ~1/10 screen */
#define LV_VDB_SIZE (60 * LV_HOR_RES) /*Size of VDB in pixel count (1/10 screen size is good for first)*/
#define LV_VDB_ADR 0X3FBFB500 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
/* Use two Virtual Display buffers (VDB) parallelize rendering and flushing (optional)
* The flushing should use DMA to write the frame buffer in the background*/
#define LV_VDB_DOUBLE 1 /*1: Enable the use of 2 VDBs*/
#define LV_VDB2_ADR 0X3FBF6A00 /*Place VDB2 to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/
/*Screen refresh settings*/
#define LV_REFR_PERIOD 50 /*Screen refresh period in milliseconds*/
#define LV_INV_FIFO_SIZE 32 /*The average count of objects on a screen */
=========== main task =================
void *vbf1 = NULL;
void *vbf2 = NULL;
vbf1 = EspAudioAlloc(1,LV_VDB_SIZE_IN_BYTES);
vbf2 = EspAudioAlloc(1,LV_VDB_SIZE_IN_BYTES);
if((NULL == vbf1) | (NULL == vbf2)){
ESP_LOGE("ili9431_lvgl_Task", "vbf alloc failed...\r\n");
abort();
}else{
lv_vdb_set_adr(vbf1,vbf2);
}
lv_init();
disp_spi_init();
ili9431_init();
lv_disp_drv_t disp;
lv_disp_drv_init(&disp);
disp.disp_flush = ili9431_flush;
disp.disp_fill = ili9431_fill;
lv_disp_drv_register(&disp);
esp_register_freertos_tick_hook(lv_tick_task);
lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(label1, "Hello world!");
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
while (1)
{
vTaskDelay(10);
lv_task_handler();
}
