Hey,
While working with the NXP Gui Guider I've come across this strange issue where the generated code cant be built for zephyr due to an extra parameter in lv_animing_set_src. I am not sure when this had changed or if its an error with the code generator but a few weeks ago the generated code worked for me.
Gui-Guider:
version used: GUI-Guider-1.7.0-GA
LVGL Version 8.3.10 selected
Target board (i.MX RT) MIMXRT1060_EVKB
Aircon Application selected to use as template
Zephyr workspace:
LVGL ver: 8.3.11
Zephyr ver: 3.6.99
Generated C code for this template
Exported code for zephyr
In File: setup_scr_ui_Aircon.c
96 | lv_animimg_set_src(ui->ui_Aircon_aircon_fan, (const void **) ui_Aircon_aircon_fan_imgs, 6, false);
Fails due to the extra paramter passed, "false" the last paramter which isnt required in this function call.
When i remove the extra paramter from the function call it seems to work as long as i add a blank "lv_font.h" file into the guider_customer_fonts directory
Is this a bug or am I missing something?
已解决! 转到解答。
Hi @RafalHalik,
From the Animation Image API for v8.3 (Animation Image (lv_animimg) — LVGL documentation), the function "lv_animimg_set_src()" only has 3 parameters:
That said, code that GUI Guider generates adds a 4th parameter to this function as a 'reverse parameter':
This allows GUI Guider to control the direction of flow of the animation with a simple switch:
Ironically, this extra parameter is not meant to be a bug, but rather a feature...
However, as I mentioned before, LVGL doesn't natively have this "feature". This can be proved by creating a project from scratch in MCUXpresso and adding the LVGL middleware afterwards. In other words, create an LVGL project outside of GUI Guider. Doing this resulted in a "lv_animimg_set_src()" function without the reverse feature, and followed the normal API description:
In conclusion, the extra parameter is added by GUI Guider as a feature, but your Zephyr workspace probably already had the LVGL middleware with the "normal" 3 parameter lv_animimg_set_src() function rather than the 4 parameter one that GUI Guider generates. deleting this extra parameter is enough to have the example work, as you mention, but you could also just add the "reverse" if-else condition that GUI Guider creates for this function and this way any GUI Guider project that uses an animated image will work on your Zephyr workspace.
I hope this helps!
BR,
Edwin.
Hi @RafalHalik,
From the Animation Image API for v8.3 (Animation Image (lv_animimg) — LVGL documentation), the function "lv_animimg_set_src()" only has 3 parameters:
That said, code that GUI Guider generates adds a 4th parameter to this function as a 'reverse parameter':
This allows GUI Guider to control the direction of flow of the animation with a simple switch:
Ironically, this extra parameter is not meant to be a bug, but rather a feature...
However, as I mentioned before, LVGL doesn't natively have this "feature". This can be proved by creating a project from scratch in MCUXpresso and adding the LVGL middleware afterwards. In other words, create an LVGL project outside of GUI Guider. Doing this resulted in a "lv_animimg_set_src()" function without the reverse feature, and followed the normal API description:
In conclusion, the extra parameter is added by GUI Guider as a feature, but your Zephyr workspace probably already had the LVGL middleware with the "normal" 3 parameter lv_animimg_set_src() function rather than the 4 parameter one that GUI Guider generates. deleting this extra parameter is enough to have the example work, as you mention, but you could also just add the "reverse" if-else condition that GUI Guider creates for this function and this way any GUI Guider project that uses an animated image will work on your Zephyr workspace.
I hope this helps!
BR,
Edwin.