Description
I’ve generated a .c file with the image converter from lvgl and added the file to my code. I then wanted to use it with first declaring it with
LV_IMG_DECLARE(coffee_symbol);
but the compiler gave me the errors:
C:/Users/Noe Steiner/Documents/VSCODE_Software/LaDoria_Display/main/coffee_symbol.c:70:16: error: 'LV_COLOR_FORMAT_RGB565' undeclared here (not in a function)
70 | .header.cf = LV_COLOR_FORMAT_RGB565,
| ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/Noe Steiner/Documents/VSCODE_Software/LaDoria_Display/main/coffee_symbol.c:71:11: error: 'lv_img_header_t' has no member named 'magic'
71 | .header.magic = LV_IMAGE_HEADER_MAGIC,
| ^~~~~
C:/Users/Noe Steiner/Documents/VSCODE_Software/LaDoria_Display/main/coffee_symbol.c:71:19: error: 'LV_IMAGE_HEADER_MAGIC' undeclared here (not in a function)
71 | .header.magic = LV_IMAGE_HEADER_MAGIC,
| ^~~~~~~~~~~~~~~~~~~~~
What MCU/Processor/Board and compiler are you using?
ESP32-S3, ESP-IDF extension in VS Code
What LVGL version are you using?
9.0
What do you want to achieve?
Import a image generated with the image converter
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
const lv_img_dsc_t coffee_symbol = {
.header.cf = LV_COLOR_FORMAT_RGB565,
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.w = 50,
.header.h = 50,
.data_size = 2500 * 2,
.data = coffee_symbol_map,
};