-
-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Kconfig for Marlin #27946
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
base: bugfix-2.1.x
Are you sure you want to change the base?
Kconfig for Marlin #27946
Conversation
rename kconfig.py to kconfig_gen.py
You can study how I did it in https://github.com/MarlinFirmware/AutoBuildMarlin/blob/master/abm/js/schema.js … which is used to load and parse the data by https://github.com/MarlinFirmware/AutoBuildMarlin/blob/master/abm/editor.js |
well I suppose for now what I was able to do was make it work for Configuration_adv.h (
if |
Description
Use KConfig for configurations
sudo apt install kconfig-frontends
-or use pip-
pip install kconfiglib
If you’re using Windows and Python 3.13 or earlier,
make sure windows-curses supports it.
Install with:
python3 -m pip install windows-curses
#27917
Usage:
make genkconfig
to generate Kconfig/Kconfig_advmake menukconfig
for Configuration.hmake menukconfigadv
for Configuration_adv.hmake writekconfig
to generate Configuration.h/Configuration_adv.h for building firmwarePreliminary tests working
Needs work with additional
#define
s from config files.Requirements
Benefits
Configurations
Related Issues
so far it works, except gives this warning
One main issue is when generating Kconfig_adv. This should take into account when things are enabled/disabled in Configuration.h, however some things are defined in Marlin/src/inc/Conditionals-6-type.h / MarlinConfig.h / MarlinConfigPre.h ect.
If we could find a way to incorporate things for example: such as
HAS_MEDIA
, which in Configuration_adv.h -#define SD_PROCEDURE_DEPTH 1
(and others) is in the same#if HAS_MEDIA
block and enabled by, however, it is defined in Conditionals-1-LCD.h as so:So, basically, using the same code for Configuration.h it thinks things under that
#if
block are enabled|disabled (if it has#define
|//#define
) when it should "depend on"#if ENABLED(SDSUPPORT)
/#define HAS_MEDIA 1
but there is no real way of knowing.
for anyone that is confused, like say if everything was combined into one Kconfig file. sure it might work fine for some things, but still wont for whatever is defined in other files.
I suppose we could arbitrarily set each one, and find a way for Kconfig_adv/Configuration_adv.h to link to Kconfig/Configuration.h, or make the code work flawlessly, or just redefine everything, or put those specifically defined in Configuration.h which lead into Configuration_adv.h as I was saying earlier and put those into another file.