From 3708311e07ffa450df85b843e7afcb18705cb6f3 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Wed, 1 May 2019 22:36:58 +0300 Subject: [PATCH] Critical: hdc1080 sensor stack overflow fixed --- lighthub/modules/in_ccs811_hdc1080.cpp | 29 +++++++++++++++----------- lighthub/modules/in_ccs811_hdc1080.h | 10 +++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lighthub/modules/in_ccs811_hdc1080.cpp b/lighthub/modules/in_ccs811_hdc1080.cpp index 2104c12..36630d3 100644 --- a/lighthub/modules/in_ccs811_hdc1080.cpp +++ b/lighthub/modules/in_ccs811_hdc1080.cpp @@ -1,5 +1,7 @@ #include "modules/in_ccs811_hdc1080.h" #include "Arduino.h" +#include "options.h" +#include "Streaming.h" #ifndef CSSHDC_DISABLE @@ -7,18 +9,21 @@ CCS811 ccs811(CCS811_ADDR); ClosedCube_HDC1080 hdc1080; long ccs811Baseline; -bool CCS811ready = false; -bool HDC1080ready = false; +static bool HDC1080ready = false; +static bool CCS811ready = false; + int in_ccs811::Setup(int addr) { + if (CCS811ready) {debugSerial<