eez-open / studio

Cross-platform low-code GUI and automation
https://www.envox.eu/studio/studio-introduction/
GNU General Public License v3.0
293 stars 68 forks source link

[LVGL] Add an option to generate image descriptions for old Expressif compilers (ESP32) #376

Open RE2012 opened 1 month ago

RE2012 commented 1 month ago

Is your feature request related to a problem? Please describe. If you try to use the generated project eez_lvgl_demo (with eez studio 0.13.0) in Arduino 2.3.2 with ESP32-S3 (Espressif 2.0.11, latest version) with images then it will fail here: const lv_img_dsc_t img_logo_eez = { .header.cf = LV_IMG_CF_RGB565A8, .header.always_zero = 0, .header.reserved = 0, .header.w = 220, .header.h = 64, .data_size = 42240, .data = img_logo_eez_map, };

More details are reported here in the LVGL forum: Using images in LVGL, getting “error: expected primary-expression before ‘.’ token”

Describe the solution you'd like It fails as the old Expressif compiler does not support these features. Instead it is required for this compiler to list values without variable names like this:

const lv_img_dsc_t img_logo_eez = { LV_IMG_CF_RGB565A8, // .header.cf = LV_IMG_CF_RGB565A8, 0, // .header.always_zero = 0, 0, // .header.reserved = 220, // .header.w = 220, 64, // .header.h = 64, 42240, // .data_size = 42240, img_logo_eez_map//.data = img_logo_eez_map };

It would be great, if you can tick an option it in the project settings so studio will generate the correct code for this compiler directly.

Describe alternatives you've considered Workaround: fixed all image code manually.

mvladic commented 1 month ago

We are using this library to generate image files. I will check if there is a way to specify to this library not to use designated initializer that are introduced in C99.