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

feat(scripts): add default config generator #6522

Merged
merged 3 commits into from
Aug 23, 2024

Conversation

becseya
Copy link
Contributor

@becseya becseya commented Jul 17, 2024

This PR adds a python script that can be used to update the lv_conf.h file of an existing project based on "lv_conf.default" parameters.

Do not squash please.

XuNeo
XuNeo previously approved these changes Jul 17, 2024
scripts/generate_lv_conf.py Show resolved Hide resolved
scripts/generate_lv_conf.py Outdated Show resolved Hide resolved
@FASTSHIFT FASTSHIFT changed the title Default config generator feat(scripts): add default config generator Jul 19, 2024
@kisvegabor
Copy link
Member

Please rebase on master to fix the CI issue.

kisvegabor
kisvegabor previously approved these changes Jul 29, 2024
@becseya becseya requested a review from XuNeo July 29, 2024 11:02
@kisvegabor
Copy link
Member

@XuNeo could you take a look at this PR?

@XuNeo
Copy link
Collaborator

XuNeo commented Aug 5, 2024

Sorry for the delay. Last time I tested, it has some problem, I can try to reproduce it.

In the meanwhile, I discussion with some fellows, and question why not use Kconfig to generate the config files?
It has standard tool and we have full support with Kconfig file.

@kisvegabor
Copy link
Member

Kconfig has some important limitations. E.g. we can't handle these.

@becseya
Copy link
Contributor Author

becseya commented Aug 5, 2024

@XuNeo please try to reproduce.

Is Kconfig able to cover our use case? I'm not aware of a mode where we are able to generate a "full list" of the macro definitions with some default values being overwritten.

@vwheeler63
Copy link
Contributor

@kisvegabor @XuNeo @becseya

Hi, Everyone!

We are going to need to coordinate. @becseya , I see your new indents in lv_conf_template.h. In PR #6480, I was going through lv_conf_template.h to re-work the comments and I found the missing indent in the nested #defines inside #if LV_USE_DRAW_VG_LITE, but I missed the correct indents you made inside #if LV_USE_GIF. So I added them to the one I am submitting with extensive changes. Thank you for that. And since I also did some minor modifications to lv_conf_internal_gen.py that generates lv_conf_internal.h (which carries the new indents forward), please allow me to submit these first, as I think you will find the changes you made to lv_conf_template.h and lv_conf_internal.h will be taken care with PR #6673 (the next PR for issue #6480). If you are comfortable doing a rebase based on master after that PR is merged, I think you will find only your Python script will be needed, as the other 2 files new indents will be included therein.

Kind regards,
Vic

Copy link
Collaborator

@liamHowatt liamHowatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working for me

scripts/generate_lv_conf.py Outdated Show resolved Hide resolved
@XuNeo
Copy link
Collaborator

XuNeo commented Aug 23, 2024

@XuNeo please try to reproduce.

Sorry for the late response. I just tried the tools now and it works for me too.

@XuNeo
Copy link
Collaborator

XuNeo commented Aug 23, 2024

Is Kconfig able to cover our use case? I'm not aware of a mode where we are able to generate a "full list" of the macro definitions with some default values being overwritten.

What Kconfig can't do is configurations needs preprocessor. Other than that, it works great and has lots of tools. RTOS NuttX, Zephyr, RT-Thread etc and linux all support Kconfig.

For preprocessor, the solution in NuttX is to define it in Makefile.
See
https://github.com/apache/nuttx-apps/blob/7c4590b81801bde3cfd7f2fd0919c01c41a78024/graphics/lvgl/Makefile#L30-L32

@kisvegabor
Copy link
Member

I'd like to go with a simple and platform independent solution first. I think it's the safest bet. We can improve it later if needed.

@kisvegabor kisvegabor merged commit aebb4d3 into lvgl:master Aug 23, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants