From 7fae56dd121069cc5461b75214154e84c89069e5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 29 Dec 2021 17:49:47 +0100 Subject: Prepare for BME680 BSEC support --- .gitignore | 1 + Makefile | 6 ++++++ src/arch/posix/Makefile.inc | 5 ++++- src/driver/Kconfig | 10 ++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3a2293e..2648f2b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /src/app/prototest/prototest_local.cc.inc src/driver/dummy.cc include/driver/dummy.h +include/arch/*/driver/bme680-*/* diff --git a/Makefile b/Makefile index b8707af..5850088 100644 --- a/Makefile +++ b/Makefile @@ -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 -- cgit v1.2.3