From 6e8f2bb57b3b5b5c50478da4b9c313610fdf158d Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 22 Apr 2020 12:42:08 +0200 Subject: [PATCH] Fix ESP32 SCD30 compile error --- lib/FrogmoreScd30/FrogmoreScd30.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/FrogmoreScd30/FrogmoreScd30.cpp b/lib/FrogmoreScd30/FrogmoreScd30.cpp index 142f33c39..e610bfb92 100644 --- a/lib/FrogmoreScd30/FrogmoreScd30.cpp +++ b/lib/FrogmoreScd30/FrogmoreScd30.cpp @@ -24,8 +24,6 @@ SOFTWARE. #include #include -#ifdef ESP8266 - #define COMMAND_SCD30_CONTINUOUS_MEASUREMENT 0x0010 #define COMMAND_SCD30_MEASUREMENT_INTERVAL 0x4600 #define COMMAND_SCD30_GET_DATA_READY 0x0202 @@ -60,7 +58,9 @@ void FrogmoreScd30::begin(TwoWire *pWire, uint8_t i2cAddress) } co2NewDataLocation = -1; // indicates there is no data, so the 1st data point needs to fill up the median filter +#ifdef ESP8266 this->pWire->setClockStretchLimit(200000); +#endif this->ambientPressure = 0; } @@ -108,7 +108,11 @@ int FrogmoreScd30::clearI2CBus(void) snprintf_P(scd30log_data, sizeof(scd30log_data), "clearI2CBus"); AddLog(LOG_LEVEL_DEBUG_MORE); #endif +#ifdef ESP8266 return (twi_status()); +#else + return 0; +#endif } #ifdef SCD30_DEBUG @@ -652,5 +656,3 @@ int FrogmoreScd30::stopMeasuring(void) { return (sendCommand(COMMAND_SCD30_STOP_MEASUREMENT)); } - -#endif // ESP8266