I personally don't find it very useful to have to maintain prj.conf and prj_spi.conf for this sample. The information we need to make this application "just work" with regards to the bus is available in the devicetree, and Kconfig can now access it using dt_compat_on_bus(). Do so, enabling I2C and SPI appropriately when a sensor of the right type is on either of those buses. If no sensors are enabled, the user gets the build-time error message in main.c about no devices being found. This approach is prone to the "stuck symbol" Kconfig problem covered in our documentation, so a pristine build is necessary to change the default settings from a previous build. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2 lines
32 B
Text
2 lines
32 B
Text
CONFIG_SENSOR=y
|
|
CONFIG_BME280=y
|