From 8a0a3949fdac7c7e7d14bd2dfcc524a3fb100af2 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sun, 1 Nov 2020 13:45:17 +0100 Subject: [PATCH] fix #issue668 --- include/display.h | 4 ++++ include/macsniff.h | 4 ++++ include/senddata.h | 3 +++ src/display.cpp | 20 ++++++++++++-------- src/sensor.cpp | 1 - 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/display.h b/include/display.h index 931b201c..8fb8120f 100644 --- a/include/display.h +++ b/include/display.h @@ -4,6 +4,10 @@ #include "cyclic.h" #include "qrcode.h" +#if (COUNT_ENS) +#include "corona.h" +#endif + #if (HAS_DISPLAY) == 1 #include #elif (HAS_DISPLAY) == 2 diff --git a/include/macsniff.h b/include/macsniff.h index e216af62..e119d9a3 100644 --- a/include/macsniff.h +++ b/include/macsniff.h @@ -10,6 +10,10 @@ #include "cyclic.h" #include "led.h" +#if (COUNT_ENS) +#include "corona.h" +#endif + #define MAC_SNIFF_WIFI 0 #define MAC_SNIFF_BLE 1 #define MAC_SNIFF_BLE_CWA 2 diff --git a/include/senddata.h b/include/senddata.h index 42686688..dcebb809 100644 --- a/include/senddata.h +++ b/include/senddata.h @@ -8,7 +8,10 @@ #include "lorawan.h" #include "display.h" #include "sdcard.h" + +#if (COUNT_ENS) #include "corona.h" +#endif extern Ticker sendTimer; diff --git a/src/display.cpp b/src/display.cpp index a29cd974..18111a3f 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -67,7 +67,7 @@ void dp_setup(int contrast) { MY_DISPLAY_INVERT, USE_HW_I2C, MY_DISPLAY_SDA, MY_DISPLAY_SCL, MY_DISPLAY_RST, OLED_FREQUENCY); // use standard I2C bus at 400Khz - _ASSERT (rc != OLED_NOT_FOUND); + _ASSERT(rc != OLED_NOT_FOUND); // set display buffer obdSetBackBuffer(&ssoled, displaybuf); @@ -265,10 +265,12 @@ void dp_drawPage(time_t t, bool nextpage) { else dp_printf("WIFI:off"); if (cfg.blescan) - if (!cfg.enscount) - dp_printf("BLTH:%-5d", macs_ble); - else +#if (COUNT_ENS) + if (cfg.enscount) dp_printf(" CWA:%-5d", cwa_report()); + else +#endif + dp_printf("BLTH:%-5d", macs_ble); else dp_printf(" BLTH:off"); #elif ((WIFICOUNTER) && (!BLECOUNTER)) @@ -277,11 +279,13 @@ void dp_drawPage(time_t t, bool nextpage) { else dp_printf("WIFI:off"); #elif ((!WIFICOUNTER) && (BLECOUNTER)) - if (cfg.blescan) { + if (cfg.blescan) dp_printf("BLTH:%-5d", macs_ble); - if (cfg.enscount) - dp_printf("(CWA:%d)", cwa_report()); - } else +#if (COUNT_ENS) + if (cfg.enscount) + dp_printf("(CWA:%d)", cwa_report()); + else +#endif dp_printf("BLTH:off"); #else dp_printf("Sniffer disabled"); diff --git a/src/sensor.cpp b/src/sensor.cpp index bb34030e..b3f56440 100644 --- a/src/sensor.cpp +++ b/src/sensor.cpp @@ -6,7 +6,6 @@ #include "payload.h" #include "corona.h" #include "macsniff.h" - extern PayloadConvert payload; #endif