Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LVGL] Generated image c file must use project defined Build - Include parameter #479

Closed
drik opened this issue Aug 8, 2024 · 6 comments
Assignees
Labels
Milestone

Comments

@drik
Copy link

drik commented Aug 8, 2024

Describe the bug
When I define LVGL Include parameter in my project, EEZ still generate c file with lvgl/lvgl.h

To Reproduce
Steps to reproduce the behavior:

  1. Go to Project Settings --> Build --> LVGL Include (change tthe default 'lvgl/lvgl.h' by 'lvgl.h'
  2. Add an image (named xxx) to your project and Build
  3. Open the generated ui_image_xxx with a text editor
  4. On line 7, you can see #include "lvgl/lvgl.h"

Expected behavior
The build system must use LVGL Include parameter to generate ui_images

Desktop (please complete the following information):

  • OS: Windows
  • Version: 11

LVGL version (if used)

  • 9.x
@drik drik added the bug label Aug 8, 2024
@mvladic
Copy link
Contributor

mvladic commented Aug 8, 2024

We are using LVGL tool to generate these image files and doesn't change them afterwards. If you look closely you can see that following is generated:

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

So, you can add preprocessor definition LV_LVGL_H_INCLUDE_SIMPLE and lvgl.h will be included.

@petrubuciu
Copy link

i had to ask because i have the same problem, where to make this definition of LV_LVGL_H_INCLUDE_SIMPLE?
For now i'm editing every image_xx.c file to include the "lvgl.h" and not "lvgl/lvgl.h"
Sorry if my question is noob. thx in advance.

@mvladic
Copy link
Contributor

mvladic commented Sep 12, 2024

where to make this definition of LV_LVGL_H_INCLUDE_SIMPLE

Are you on Arduino?

@petrubuciu
Copy link

petrubuciu commented Sep 12, 2024

yes, ESP32 s3

@mvladic
Copy link
Contributor

mvladic commented Sep 12, 2024

I think you can't add preprocessor definitions using Arduino IDE.

So, I decided to prepend each generated img_xxx.c file with the following:

#ifdef __has_include
    #if __has_include("lvgl.h")
        #ifndef LV_LVGL_H_INCLUDE_SIMPLE
            #define LV_LVGL_H_INCLUDE_SIMPLE
        #endif
    #endif
#endif

This should fix the issue for Arduino.

mvladic added a commit that referenced this issue Sep 12, 2024
@mvladic
Copy link
Contributor

mvladic commented Sep 12, 2024

Implemented as described in my previous comment.

@mvladic mvladic added this to the M23 milestone Sep 13, 2024
@mvladic mvladic changed the title Generated image c file must use project defined lvglInclude parameter [LVGL] Generated image c file must use project defined Build - Include parameter Sep 13, 2024
@mvladic mvladic closed this as completed Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants