Hello:
In my project, I have the following requirements: I need to conditional compile the device tree, i.e., it needs to include a header file via #ifdef, but it can't conditional compile through autoconf.h generated by prj.conf (because the device tree compilation comes before the program compilation), how do I do it?
I tried to use the custom build command, which uses python code to identify the prj.conf file and output the required #define in the.h file included in the device tree before build, and then uses the build in ncs to conditionally compile the device tree.
I according to github.com/.../
Add yml and py files, but I can't find the new extension command using west -h in the console, now I have no way of knowing if I did something wrong. Or if there are new ways to solve the problem.
I knew that maybe I could create two device tree files and then add two build configurations. Still, I wonder if it is possible to control conditional compilation of the device tree via prj.conf.
Thanks!