Add the pinned Sensirion SEN66 driver, central sensor and board profiles, and a separate GPIO I2C bus for SEN66 with display. Preserve the original display layout and keep NOx and CO2 in InfluxDB. Include protocol tests, hardware workflow documentation and verified deployment results without credentials.
32 lines
1.2 KiB
Bash
32 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.."
|
|
test_dir=$(mktemp -d)
|
|
trap 'rm -rf -- "$test_dir"' EXIT
|
|
driver=components/sen5x
|
|
cc -std=c11 -Wall -Wextra -I"$driver" test/sensors/test_protocol.c \
|
|
"$driver/sen5x_i2c.c" "$driver/sen66_i2c.c" \
|
|
"$driver/sensirion_common.c" "$driver/sensirion_i2c.c" \
|
|
-o "$test_dir/protocol"
|
|
"$test_dir/protocol"
|
|
cc -std=c11 -Wall -Wextra -Werror -I"$driver" \
|
|
test/sensors/test_soft_i2c.c "$driver/sensor_soft_i2c.c" -o "$test_dir/soft-i2c"
|
|
"$test_dir/soft-i2c"
|
|
|
|
# Compile all four hardware combinations; invalid selections must fail.
|
|
for board in 1 2; do
|
|
for sensor in 54 66; do
|
|
printf '#include "hardware_config.h"\nint main(void) {return 0;}\n' |
|
|
cc -std=c11 -Werror -Icomponents/hardware_config -DNANOPSX_BOARD="$board" \
|
|
-DNANOPSX_SENSOR="$sensor" -x c - -o "$test_dir/config"
|
|
done
|
|
done
|
|
for invalid in NANOPSX_BOARD=999 NANOPSX_SENSOR=999; do
|
|
if printf '#include "hardware_config.h"\n' |
|
|
cc -Icomponents/hardware_config -D"$invalid" -x c -c -o "$test_dir/invalid.o" - 2>/dev/null; then
|
|
echo "Invalid configuration was accepted: $invalid" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
echo 'PASS: all four board/sensor selections and invalid-profile rejection'
|