Skip to content

Commit 8016588

Browse files
authored
Correct preprocessor directive syntax
The previous incorrect syntax cause compilation of the library to fail: SparkFun_CCS811_Arduino_Library\src\SparkFunCCS811.cpp:61:8: error: macro names must be identifiers #ifdef (ARDUINO_ARCH_ESP32 ARDUINO_ARCH_ESP8266) ^ Note that compilation for ESP32 still fails with a different error: SparkFun_CCS811_Arduino_Library\src\SparkFunCCS811.cpp:62:7: error: 'class TwoWire' has no member named 'setClockStretchLimit' Wire.setClockStretchLimit(200000);// was defautl 230 uS, now 200ms ^ From espressif/arduino-esp32#81, it's not clear whether there are plans to ever add the setClockStretchLimit function for ESP32.
1 parent 4341769 commit 8016588

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SparkFunCCS811.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ CCS811Core::status CCS811Core::beginCore(void)
5858
#else
5959
#endif
6060

61-
#ifdef (ARDUINO_ARCH_ESP32 ARDUINO_ARCH_ESP8266)
61+
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
6262
Wire.setClockStretchLimit(200000);// was defautl 230 uS, now 200ms
6363
#else
6464
#endif

0 commit comments

Comments
 (0)