summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-12-29 17:49:47 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-12-29 17:49:47 +0100
commit7fae56dd121069cc5461b75214154e84c89069e5 (patch)
tree4f91e11a10b3cead331220d506b7c0e53898fe48
parent9318c681f5e198d9541a3259066f415dbd351af0 (diff)
Prepare for BME680 BSEC support
-rw-r--r--.gitignore1
-rw-r--r--Makefile6
-rw-r--r--src/arch/posix/Makefile.inc5
-rw-r--r--src/driver/Kconfig10
4 files changed, 21 insertions, 1 deletions
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