Code: Select all
[size=85]- common_code/
- component1/
- include/ - component1.h
- Kconfig
- src1.c
- component2/
- include/ - component2.h
- Kconfig
- src2.c
- Project_1/
- build/
- main/
- src3.c
- src4.c
- CMakeLists.txt
- CMakeLists.txt
- sdkconfig
- Project_2/
- build/
- main/
- src5.c
- src6.c
- CMakeLists.txt
- CMakeLists.txt
- sdkconfig[/size]
The common_code folder contains various hardware drivers that are used by both Project_1 and Project_2. However, the GPIO configurations and some other parameters are different. The Kconfig in each component folder contains a “default” configuration.
This is an example of the Kconfig for the accelerometer component.
Code: Select all
[size=85]menu "Accelerometer Component Configuration"
menu "Accelerometer Configuration"
config ACCELEROMETER_I2C_ADDRESS
int "Accelerometer I2C Addess"
default 24
range 0 255
help
I2C Address of accelerometer.
config ACCELEROMETER_INTERRUPT_GPIO
int "Accelerometer Interrupt Pin Number"
default 4
range 0 31
help
Pin number of accelerometer interrupt GPIO.
endmenu
endmenu[/size]
However, when I build the project, the sdkconfig settings are overwritten by the Kconfig settings.
I could, of course, have a sdkconfig.default or so in each Project folder, but that would require this to be created/copied manually and
if a new setting is added to a component, all projects needs to have their sdkconfig.default files updated manually.
As it is now, it looks smooth, the component setting show up in sdkconfig. But sadly, it doesn’t work, as I cannot change the config, per project.
Any ideas how to accomplish this?
Did I miss something?