diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-12-29 17:49:47 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-12-29 17:49:47 +0100 |
commit | 7fae56dd121069cc5461b75214154e84c89069e5 (patch) | |
tree | 4f91e11a10b3cead331220d506b7c0e53898fe48 | |
parent | 9318c681f5e198d9541a3259066f415dbd351af0 (diff) |
Prepare for BME680 BSEC support
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | src/arch/posix/Makefile.inc | 5 | ||||
-rw-r--r-- | src/driver/Kconfig | 10 |
4 files changed, 21 insertions, 1 deletions
@@ -18,3 +18,4 @@ /src/app/prototest/prototest_local.cc.inc src/driver/dummy.cc include/driver/dummy.h +include/arch/*/driver/bme680-*/* @@ -17,6 +17,7 @@ endif quote=" app_dir = $(subst ${quote},,${CONFIG_app}) arch_dir = $(subst ${quote},,${CONFIG_arch}) +bsec_dir = $(subst ${quote},,${CONFIG_driver_bme680_bsec_path}) INCLUDES = -Iinclude -Iinclude/arch/${arch_dir} CFLAGS = -std=c99 @@ -27,6 +28,7 @@ QUIET = @ ASM_TARGETS = C_TARGETS = CXX_TARGETS = src/app/${app_dir}/main.cc src/object/cpp_helpers.cc src/object/outputstream.cc +SO_TARGETS = ifdef verbose QUIET = @@ -64,6 +66,10 @@ ifdef CONFIG_driver_bme680 CXX_TARGETS += src/driver/bme680.cc src/driver/bme680_util.cc endif +ifdef CONFIG_driver_bme680_bsec + SO_TARGETS += include/arch/${arch_dir}/driver/${bsec_dir}/libalgobsec.a +endif + ifdef CONFIG_driver_ccs811 CXX_TARGETS += src/driver/ccs811.cc endif diff --git a/src/arch/posix/Makefile.inc b/src/arch/posix/Makefile.inc index 539e5f4..b06a29d 100644 --- a/src/arch/posix/Makefile.inc +++ b/src/arch/posix/Makefile.inc @@ -41,7 +41,7 @@ ifdef CONFIG_arch_posix_driver_uptime CXX_TARGETS += src/arch/posix/driver/uptime.cc endif -OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} +OBJECTS = ${SO_TARGETS:.a=.so} ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} ifneq (${gpio_trace}, ) COMMON_FLAGS += -DGPIO_TRACE @@ -56,6 +56,9 @@ endif %.o: %.c | include/config.h ${QUIET}${CC} ${INCLUDES} ${COMMON_FLAGS} ${CFLAGS} -c -o $@ ${@:.o=.c} +%.so : %.a | include/config.h + ${QUIET}${CC} -shared -o $@ -Wl,--whole-archive ${@:.so=.a} -Wl,--no-whole-archive + build/system.elf: ${OBJECTS} ${QUIET}mkdir -p build ${QUIET}${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} \ diff --git a/src/driver/Kconfig b/src/driver/Kconfig index 3ff88e7..b626776 100644 --- a/src/driver/Kconfig +++ b/src/driver/Kconfig @@ -35,6 +35,16 @@ config driver_bme680 bool "BME680 TPH+IAQ Sensor" depends on meta_driver_i2c && !driver_bme280 +config driver_bme680_bsec +bool "with BSEC (proprietary library for IAQ calculation)" +depends on driver_bme680 + +config driver_bme680_bsec_path +string "BSEC library path" +default "bme680-bsec" if arch_msp430fr5994lp +default "bme680-bsec-armv6" if arch_posix +depends on driver_bme680_bsec && (arch_msp430fr5994lp || arch_posix) + config driver_ccs811 bool "CCS811 VOC Sensor" depends on meta_driver_i2c |