From 6463eeb415ab97fef76e82caa8f88ef67fd3a04a Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Tue, 20 Nov 2018 21:24:35 +0100 Subject: [PATCH] bugfix rcommand.cpp in set_sensor() --- src/hal/ttgobeam.h | 6 +++++- src/rcommand.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hal/ttgobeam.h b/src/hal/ttgobeam.h index b5134fd7..234ff03c 100644 --- a/src/hal/ttgobeam.h +++ b/src/hal/ttgobeam.h @@ -5,7 +5,11 @@ // Hardware related definitions for TTGO T-Beam board -#define HAS_SENSORS 1 // test +////////////// test ////////// +// enable only if device has these sensors, otherwise comment these lines +#define HAS_BME 0x77 // BME680 sensor on I2C bus (default SDA=21/SCL=22); comment out if not present +//#define HAS_SENSORS 1 // comment out if device has user defined sensors +////////////// test ////////// #define HAS_LORA 1 // comment out if device shall not send data via LoRa #define CFG_sx1276_radio 1 // HPD13A LoRa SoC diff --git a/src/rcommand.cpp b/src/rcommand.cpp index bd417b0e..cf9101b1 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -133,6 +133,7 @@ void set_gps(uint8_t val[]) { } void set_sensor(uint8_t val[]) { +#ifdef HAS_SENSORS switch (val[0]) { // check if valid sensor number 1...4 case 1: case 2: @@ -153,6 +154,7 @@ void set_sensor(uint8_t val[]) { cfg.payloadmask |= sensor_mask(val[0]); // set bit else cfg.payloadmask &= ~sensor_mask(val[0]); // clear bit +#endif } void set_beacon(uint8_t val[]) {