please verify the code below.
initStaticBackgroud() function is being called once at the beginning of set up.
And tft_display function is being called every 1 sec continuously. Image shape is being loaded with black solid color. If I try to load that image from flash using EVE Image Editor tool, then I am able to load with colors. so I confirmed that image stored in flash has correct details and not corrupted. it's just when I try to load using ESP32 with below code, is when I am getting issue. something I am not following correctly I think.
void initStaticBackground(void)
{
EVE_cmd_dl(CMD_DLSTART); /* Start the display list */
EVE_cmd_dl(TAG(0)); /* do not use the following objects for touch-detection */
EVE_cmd_bgcolor(0x00ffffff ); /* light grey */
EVE_cmd_dl(VERTEX_FORMAT(0)); /* reduce precision for VERTEX2F to 1 pixel instead of 1/16 pixel default */
/* draw a rectangle on top */
EVE_cmd_dl(DL_BEGIN | EVE_RECTS);
EVE_cmd_dl(LINE_WIDTH(1*16)); /* size is in 1/16 pixel */
EVE_cmd_dl(DL_COLOR_RGB | RED);
EVE_cmd_dl(VERTEX2F(0,0));
EVE_cmd_dl(VERTEX2F(EVE_HSIZE,LAYOUT_Y1-2));
EVE_cmd_dl(DL_END);
/* draw a black line to separate things */
EVE_cmd_dl(DL_COLOR_RGB | BLACK);
EVE_cmd_dl(DL_BEGIN | EVE_LINES);
EVE_cmd_dl(VERTEX2F(0,LAYOUT_Y1-2));
EVE_cmd_dl(VERTEX2F(EVE_HSIZE,LAYOUT_Y1-2));
EVE_cmd_dl(DL_END);
/* Import an image from the Flash memory */
EVE_cmd_flashsource(4096);
uint8_t *data = (uint8_t *)malloc(10368 + 1);
EVE_cmd_loadimage(4096, EVE_OPT_FLASH, data, 10368);
free(data);
EVE_cmd_dl(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_dl(VERTEX2F(120, 135));
EVE_cmd_dl(DL_END);
EVE_cmd_text(EVE_HSIZE/2, 15, 29, EVE_OPT_CENTERX, "Hello World!");
/* add the static text to the list */
EVE_cmd_text(10, EVE_VSIZE - 65, 26, 0, "Bytes:");
EVE_cmd_text(10, EVE_VSIZE - 50, 26, 0, "DL-size:");
EVE_cmd_text(10, EVE_VSIZE - 35, 26, 0, "Time1:");
EVE_cmd_text(10, EVE_VSIZE - 20, 26, 0, "Time2:");
EVE_cmd_text(125, EVE_VSIZE - 35, 26, 0, "us");
EVE_cmd_text(125, EVE_VSIZE - 20, 26, 0, "us");
while (EVE_busy()) {};
num_dl_static = EVE_memRead16(REG_CMD_DL);
EVE_cmd_memcpy(MEM_DL_STATIC, EVE_RAM_DL, num_dl_static);
while (EVE_busy()) {};
}
void TFT_display(void)
{
static int32_t rotate = 0;
if(tft_active != 0)
{
#if defined (EVE_DMA)
uint16_t cmd_fifo_size;
cmd_fifo_size = EVE_dma_buffer_index*4; /* without DMA there is no way to tell how many bytes are written to the cmd-fifo */
#endif
EVE_start_cmd_burst(); /* start writing to the cmd-fifo as one stream of bytes, only sending the address once */
EVE_cmd_dl_burst(CMD_DLSTART); /* start the display list */
EVE_cmd_dl_burst(DL_CLEAR_RGB | WHITE); /* set the default clear color to white */
EVE_cmd_dl_burst(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG); /* clear the screen - this and the previous prevent artifacts between lists, Attributes are the color, stencil and tag buffers */
EVE_cmd_dl_burst(TAG(0));
EVE_cmd_append_burst(MEM_DL_STATIC, num_dl_static); /* insert static part of display-list from copy in gfx-mem */
EVE_cmd_dl_burst(DL_COLOR_RGB | WHITE);
EVE_cmd_setbitmap_burst(4096, EVE_COMPRESSED_RGBA_ASTC_8x8_KHR, 181, 185); /* display directly from FLASH */
EVE_cmd_dl_burst(VERTEX2F(200, 100));
EVE_cmd_dl_burst(DL_END);
EVE_cmd_dl_burst(DL_BEGIN | EVE_BITMAPS);
/* display a button */
EVE_cmd_fgcolor_burst(0x00ffffff); /* some grey */
EVE_cmd_dl_burst(TAG(10)); /* assign tag-value '10' to the button that follows */
EVE_cmd_button_burst(20,20,80,30, 28, toggle_state,"Hey!");
EVE_cmd_dl_burst(TAG(0)); /* no touch */
#if defined (EVE_DMA)
EVE_cmd_number_burst(120, EVE_VSIZE - 65, 26, EVE_OPT_RIGHTX, cmd_fifo_size); /* number of bytes written to the cmd-fifo */
#endif
EVE_cmd_number_burst(120, EVE_VSIZE - 50, 26, EVE_OPT_RIGHTX, display_list_size); /* number of bytes written to the display-list by the command co-pro */
EVE_cmd_number_burst(120, EVE_VSIZE - 35, 26, EVE_OPT_RIGHTX|5, num_profile_a); /* duration in �s of TFT_loop() for the touch-event part */
EVE_cmd_number_burst(120, EVE_VSIZE - 20, 26, EVE_OPT_RIGHTX|5, num_profile_b); /* duration in �s of TFT_loop() for the display-list part */
EVE_cmd_dl_burst(DL_DISPLAY); /* instruct the graphics processor to show the list */
EVE_cmd_dl_burst(CMD_SWAP); /* make this list active */
EVE_end_cmd_burst(); /* stop writing to the cmd-fifo, the cmd-FIFO will be executed automatically after this or when DMA is done */
}
}